As we use, $routeProvider
in config method, as of my knowledge $route
is a provider.
So, I tried adding new routes to $route
in my controller:
After configuring and bootstrapping the application, somewhere in my controller, I tried this:
app.controller('MyCtrl',function($scope,$route) {
$route.routes['/newRoute'] = { template : 'hey, this is dynamically added route' };
});
But this doesn't seem to work. why?
Any Ideas?