Hi,
I am facing a problem with the routing-provider. As I can say at the moment, it's not possible to alter the routes into the runtime without some hacks, but I gues, I'm just doing something wrong. I load the navigation items from a dynamically generated json(REST). The navigation depends on User-Rights and other stuff.
So my current solution is to declare a variable into the global Scope to exchange the route-provider to a service, which creates the routing at runtime. I don't think, that this is a good solution, so I ask if there is an "best-practice" for this.
What I am doing now:
app.js
var uglyHackedRouteProvider = null;
[...]
config(['$routeProvider', function ($routeProvider, $location,$RouteProvider)
{
uglyHackedRouteProvider = $routeProvider
}
In services.js
factoryObject.routeProvider = uglyHackedRouteProvider;
Any ideas to solve this a little bit nicer?