Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Per-route option to trigger $routeUpdate instead of reloading the same controller #975

Closed
nickretallack opened this issue May 22, 2012 · 1 comment
Assignees

Comments

@nickretallack
Copy link

If you are looking at a page and you click a link that routes to the same controller you're already looking at again, angular throws that controller instance away and creates a new one. That is, unless you only changed the 'search' part of the url and reloadOnSearch:false is set for the current route. In that case it just fires $routeUpdate and you can check the $routeParams to see the differences.

I see no reason why this feature has to be restricted to the 'search' part of the url though. I'd love to see a per-view option just like reloadOnSearch:false that would simply fire $routeUpdate if you happened to hit a route back to the same controller again. You could then pull the new values out of the $routeParams just like with reloadOnSearch:false. The benefit from this is prettier urls, and not having to structure your urls differently just so you can enable navigation within a view without redrawing the whole ng-view.

I could probably write the patch for this myself when I get the time.

@jeffbcross jeffbcross self-assigned this Feb 4, 2014
@jeffbcross
Copy link
Contributor

Duplicate of #5581 (although this issue preceded it, #5581 has more conversation).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants