fix(animations): ensure multi-level route leave animations are queryable (#20787)

Closes #19807

PR Close #20787
This commit is contained in:
Matias Niemelä
2017-12-04 16:00:05 -08:00
committed by Jason Aden
parent d098cf5a8b
commit 13e663c232
2 changed files with 89 additions and 4 deletions

View File

@ -312,9 +312,13 @@ export class AnimationTransitionNamespace {
// If there are no animations found for any of the nodes then clear the cache
// for the element.
this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true).forEach(elm => {
// this means that an inner remove() operation has already kicked off
// the animation on this element...
if (elm[REMOVAL_FLAG]) return;
const namespaces = this._engine.fetchNamespacesByElement(elm);
if (namespaces.size) {
namespaces.forEach(ns => { ns.triggerLeaveAnimation(elm, context, false, true); });
namespaces.forEach(ns => ns.triggerLeaveAnimation(elm, context, false, true));
} else {
this.clearElementCache(elm);
}