Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was 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

Description

@nickretallack

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions