MCPcopy Index your code
hub / github.com/angular/angular / trackLeavingNodes

Function trackLeavingNodes

packages/core/src/animation/utils.ts:234–249  ·  view source on GitHub ↗
(tNode: TNode, el: HTMLElement, lView?: LView)

Source from the content-addressed store, hash-verified

232 * duplicates from showing up on screen mid-animation.
233 */
234export 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

Callers 3

animateLeaveClassRunnerFunction · 0.90

Calls 5

getDeclarationViewFunction · 0.85
someMethod · 0.80
getMethod · 0.65
setMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…