MCPcopy Create free account
hub / github.com/angular/angular / collectNestedViewAnimations

Function collectNestedViewAnimations

packages/core/src/render3/node_animations.ts:333–358  ·  view source on GitHub ↗

* Collects leave animations from nested views (containers only, NOT child components) * starting from the given TNode's children.

(
  lView: LView,
  tNode: TNode,
  collectedPromises: Promise<unknown>[],
)

Source from the content-addressed store, hash-verified

331 * starting from the given TNode's children.
332 */
333function collectNestedViewAnimations(
334 lView: LView,
335 tNode: TNode,
336 collectedPromises: Promise<unknown>[],
337) {
338 // We explicitly DO NOT check for isComponentHost(tNode) and traverse into it here.
339 // This scopes the nested leave animations to the current component template only.
340
341 if (tNode.type & TNodeType.AnyContainer) {
342 const lContainer = lView[tNode.index];
343 if (isLContainer(lContainer)) {
344 for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
345 const subView = lContainer[i] as LView;
346 if (subView[TVIEW].type === TViewType.Embedded) {
347 collectAllViewLeaveAnimations(subView, collectedPromises);
348 }
349 }
350 }
351 }
352
353 let child = tNode.child;
354 while (child) {
355 collectNestedViewAnimations(lView, child, collectedPromises);
356 child = child.next;
357 }
358}
359
360/**
361 * Recursively collects all leave animations from a view and its children.

Callers 2

executeLeaveAnimationsFunction · 0.85

Calls 2

isLContainerFunction · 0.90

Tested by

no test coverage detected