Reputation: 12184
Say, I have a route like: #/path/to/route/:dynamicParamter
Now whenever I click on a link where just that part is changing, angular loads the whole controller. Is there a way I can avoid this and just let my controller to all UI changes based on URL without having to reload ?
Upvotes: 1
Views: 75
Reputation: 42669
If you are ready to use dynamicParamter
as a querystring parameter, then you can use the $routeProvider reloadOnSearch
to false. See $routeProvider documentation.
In this case your dynamicParameter
changes should only change the querystring parameter and the controller would not get loaded.
To know when the querystring change look at $route#$routeUpdate
event.
Upvotes: 2