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

Function addToAnimationQueue

packages/core/src/animation/queue.ts:40–62  ·  view source on GitHub ↗
(
  injector: Injector,
  animationFns: VoidFunction | VoidFunction[],
  animationData?: AnimationLViewData,
)

Source from the content-addressed store, hash-verified

38);
39
40export function addToAnimationQueue(
41 injector: Injector,
42 animationFns: VoidFunction | VoidFunction[],
43 animationData?: AnimationLViewData,
44) {
45 const animationQueue = injector.get(ANIMATION_QUEUE);
46 if (Array.isArray(animationFns)) {
47 for (const animateFn of animationFns) {
48 animationQueue.queue.add(animateFn);
49 // If a node is detached, we need to keep track of the queued animation functions
50 // so we can later remove them from the global animation queue if the view
51 // is re-attached before the animation queue runs.
52 animationData?.detachedLeaveAnimationFns?.push(animateFn);
53 }
54 } else {
55 animationQueue.queue.add(animationFns);
56 // If a node is detached, we need to keep track of the queued animation functions
57 // so we can later remove them from the global animation queue if the view
58 // is re-attached before the animation queue runs.
59 animationData?.detachedLeaveAnimationFns?.push(animationFns);
60 }
61 animationQueue.scheduler && animationQueue.scheduler(injector);
62}
63
64export function removeAnimationsFromQueue(
65 injector: Injector,

Callers 2

queueEnterAnimationsFunction · 0.85

Calls 4

isArrayMethod · 0.80
getMethod · 0.65
addMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…