-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngView cleanup order #7606
Comments
guys, this looks like a no-brainer issue. why is it still open? cc: @matsko, @tbosch, @jeffbcross |
I think that @geddski is wrong. the current code is not incorrect because the current view is removed via @matsko do we need this fallback at all? wouldn't it make it impossible to have more than one leave animation in progress? why would that be a bad thing? |
"no-brainer" he says |
Is that the case for apps that aren't using ngAnimate? |
@jeffbcross I mean that it's an issue that can be resolved quickly, not necessarily that @geddski's proposal is right. |
it's unnecessary and inconsistent (because finishing animations reset we see situations where not previousElement is not always removed and more than one leave animation is going on at the same time). Closes angular#7606
it's unnecessary and inconsistent (because finishing animations reset we see situations where not previousElement is not always removed and more than one leave animation is going on at the same time). Closes angular#7606 Closes angular#9355
I opened a PR. @matsko please review |
here is a plunker with the demo of the current state: http://plnkr.co/edit/O3OYwOzihJgokI7gLLQ4?p=preview |
@IgorMinar our triage and planning process is flawed. We don't do a good job of reviewing issues by frequency/severity. |
you may want to double check, I'm pretty certain it doesn't cleanup until you've visited the third view. If I'm right @IgorMinar owe's me lunch. |
@geddski you are wrong |
@matsko convinced me that my PR is wrong too, so I'm going to change it: #9355 (comment) |
…ion occurs at a time the tracking depended on a local flag variable, which was susceptible to corruption due to race conditions. Closes angular#9355 Closes angular#7606
…ion occurs at a time the tracking depended on a local flag variable, which was susceptible to corruption due to race conditions. Closes angular#9355 Closes angular#7606 Closes angular#9374
…ion occurs at a time the tracking depended on a local flag variable, which was susceptible to corruption due to race conditions. using promises ensures that the previousLeaveAnimation is nulled out only if it hasn't been canceled yet. Closes angular#9355 Closes angular#7606 Closes angular#9374
@matsko I think the ngView cleanup order is incorrect. Current it's:
So a user lands on a page, the first view is shown, and
currentElement
is set. Next the user clicks on a link to go to the second view.cleanupLastView()
gets called and should cleanup the first view. ButpreviousElement
is undefined still (it gets set below which is too late) and so the cleanup does not happen.Only after navigating to a third view is
previousElement
defined and the cleanup starts to work.Also it seems to me like the scope should be destroyed before the element is removed, but maybe that doesn't matter.
Correct me if I'm wrong but I think the order should be:
The text was updated successfully, but these errors were encountered: