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

Switching between sibling routes results in the scope not being destroyed in ngRoute #11112

Closed
smhc opened this issue Feb 20, 2015 · 2 comments
Closed

Comments

@smhc
Copy link

smhc commented Feb 20, 2015

The same issue as reported to ui-router also exists in ngRoute: angular-ui/ui-router#1766

The scope for the landing route is retained in the heap even when that state is navigated away. See the below for an example:

http://plnkr.co/edit/tS1z9PgWM927a3joiC95

Navigate to route B, then perform a heap snapshot. Both SibAObject and SibBObject will be on the heap. However, landing on '/home' first, then navigating between /home/a and /home/b allow the scopes to be dereferenced and freed correctly.

@smhc
Copy link
Author

smhc commented Mar 25, 2015

I've dug up this unresolved issue which appears similar: #3543

That old issue is apparently IE9 specific. However this new issue affects modern browsers (confirmed in chrome at least). Despite that, the reproduction code for the two issues is very similar.

@smhc
Copy link
Author

smhc commented May 29, 2015

Good news - this appears fixed in angular 1.4. Or at least, the reproduction code above no longer reproduces the problem when modified to use 1.4.

The fix appears to have come in on v1.3.15, most likely from the changes under issue: #11173

@smhc smhc closed this as completed May 29, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants