Dynamic routes in AngularJS?

fgonzalez

I'm pretty new to AngularJS, so far I have learnt that providers are used to configure the services that will be used later during the execution phase. Particularly, routes are configured during the configuration phase using $routeProvider and then we can access the routes in our controller using the service $route.

I would like to know if once I have set up the routes with $routeProvider, if it's possible to modify the routes, add new ones or delete existing ones using the service $route (during the execution phase). So basically if we can have a kind of dynamic routes, and if so, how can we achieve this.

Thank you!!

AlexHv

nope, the $route service is configured during the config phase via the $routeProvider service, and this phase happens only once when starting the app.

If you want to add dynamic behavior to the url, you ca still manipulate the search parameter thanks to $location.search().

(and then $watch the changes or whatever you want to do)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related