I have an Angular app, which is a dashboard style app that allows users to drill down n number of levels. I'm trying to set up dynamic paths, which append a new dashboard id every time a user drills down. So for example, the root dashboard will look like this:
/reporting/dashboard/root
Then if a user drills down 4 times, it may look something like this:
/reporting/dashboard/root/dashboard1/dashboard2/dashboard3/dashboard4
I've tried using a regex pattern in my state config to no avail. I can't figure out how to append the path when calling $state.go()
.
state: 'dashboard',
config: {
url:"/reporting/dashboard/{path:.*}",
templateUrl: function(params) {
var path = params.path.split('/').reverse(),
var guid = path[0];
params.guid = guid;
return 'views/dashboard/dashboard.html';
},
controller:'DashboardController'
}
Any help would be greatly appreciated! Maybe there is a better way to accomplish this?