(tNode: TNode, el: HTMLElement, lView?: LView)
| 232 | * duplicates from showing up on screen mid-animation. |
| 233 | */ |
| 234 | export function trackLeavingNodes(tNode: TNode, el: HTMLElement, lView?: LView): void { |
| 235 | // We need to track this tNode's element just to be sure we don't add |
| 236 | // a new RNode for this TNode while this one is still animating away. |
| 237 | // once the animation is complete, we remove this reference. |
| 238 | // The declaration view is recorded so `cancelLeavingNodes` can tell apart two |
| 239 | // separate instances of the same template from the same view re-rendered. |
| 240 | const declarationView = getDeclarationView(lView); |
| 241 | const nodes = leavingNodes.get(tNode); |
| 242 | if (nodes) { |
| 243 | if (!nodes.some((node) => node.el === el)) { |
| 244 | nodes.push({el, declarationView}); |
| 245 | } |
| 246 | } else { |
| 247 | leavingNodes.set(tNode, [{el, declarationView}]); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * Retrieves the list of specified enter animations from the lView |
no test coverage detected
searching dependent graphs…