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

Function runAfterLeaveAnimations

packages/core/src/render3/node_animations.ts:393–411  ·  view source on GitHub ↗
(
  lView: LView,
  tNode: TNode,
  runningAnimations: Promise<unknown>,
  callback: Function,
)

Source from the content-addressed store, hash-verified

391}
392
393function runAfterLeaveAnimations(
394 lView: LView,
395 tNode: TNode,
396 runningAnimations: Promise<unknown>,
397 callback: Function,
398) {
399 runningAnimations.then(() => {
400 // We only want to clear the running flag and the allLeavingAnimations set if
401 // the current running animation is the same as the one we just waited for.
402 // If it's different, it means another animation started while we were waiting,
403 // and that other animation is now responsible for clearing the flag.
404 if (lView[ANIMATIONS]?.running === runningAnimations) {
405 lView[ANIMATIONS]!.running = undefined;
406 allLeavingAnimations.delete(lView[ID]);
407 }
408 clearTrackedLeavingNode(lView, tNode);
409 callback(true);
410 });
411}
412
413/**
414 * Recursively initializes the detached leave animations list for a view and all its nested

Callers 1

executeLeaveAnimationsFunction · 0.85

Calls 4

clearTrackedLeavingNodeFunction · 0.85
thenMethod · 0.65
callbackFunction · 0.50
deleteMethod · 0.45

Tested by

no test coverage detected