I am in the process of developing a web application similar to gdrive or dropbox. As I navigate through my folders via links, I require the path to be displayed in the URL. I want to update the path from the client side using AngularJS.
For example:
$stateProvider
.state('/root',
{
url: "/root",
templateUrl: "cloud.html"
})
.state('root.___',
{
url: "/root/:path",
templateUrl: "cloud.html"
})
.otherwise({ redirectTo: "/root" });
});
The controller and template do not need to be altered, only the URL needs to be changed to appear as follows:
http://mycloud.com/newfolder/newfolder or http://mycloud.com/newfolder/.../.../../folder
How can this be achieved in AngularJS UI-Router? What needs to be filled in the blank space?