Closed groner closed 9 years ago
I'll work on getting a working demonstration and/or test case.
If you could manage to get that into a plunker that would be great so I can dig into it.
The fix as done here smells like treating a symptom rather than the root cause, and obviously we would like to fix the root cause instead. We might have to live with that until the root cause can be identified though...
@jeme I assume you're still interested in seeing a plunk?
I wasn't able to create a plunk showing the issue. I can try using our application and taking away pieces until I've isolated the issue.
Yes I would still be interested in a plunk to identify the root cause.
We ran into this in our application when we redefined a mid level view for a state to use a custom controller, but the same template. I think there is a transition in effect that could be playing a part in the timing.
The following is pseudo-code that attempts to describe the situation. I'll work on getting a working demonstration and/or test case.
top.foo
totop.bar
there is an oldjem-view=middle
and a newjem-view=middle
, each contain ajem-view=main
.jem-view=main
observes a view event and it'supdate()
requests the template. At this point thejem-view
is still a descendant of the root element and its scope is still valid.jem-view=middle
scope is destroyed and detached from it's parent.jem-view=main
proceeds to compile and link the template contents against a new child scope.Directives in the template will not see a
$destroy
event (it already fired), and can therefore leak resources.