MCPcopy
hub / github.com/angular/angular / ɵɵanimateLeave

Function ɵɵanimateLeave

packages/core/src/render3/instructions/animation.ts:249–278  ·  view source on GitHub ↗
(value: string | AnimationClassBindingFn)

Source from the content-addressed store, hash-verified

247 * @codeGenApi
248 */
249export function ɵɵanimateLeave(value: string | AnimationClassBindingFn): typeof ɵɵanimateLeave {
250 performanceMarkFeature('NgAnimateLeave');
251
252 if ((typeof ngServerMode !== 'undefined' && ngServerMode) || !areAnimationSupported) {
253 return ɵɵanimateLeave;
254 }
255
256 ngDevMode && assertAnimationTypes(value, 'animate.leave');
257
258 const lView = getLView();
259 const animationsDisabled = areAnimationsDisabled(lView);
260 if (animationsDisabled) {
261 return ɵɵanimateLeave;
262 }
263
264 const tNode = getCurrentTNode()!;
265
266 // Capture NgZone eagerly while the injector is still valid. The animation
267 // function runs later from the queue, at which point the lView injector
268 // may have been destroyed.
269 const ngZone = lView[INJECTOR]!.get(NgZone);
270
271 addAnimationToLView(getLViewLeaveAnimations(lView), tNode, () =>
272 runLeaveAnimations(lView, tNode, value, ngZone),
273 );
274
275 initializeAnimationQueueScheduler(lView[INJECTOR]);
276
277 return ɵɵanimateLeave; // For chaining
278}
279
280function runLeaveAnimations(
281 lView: LView,

Callers

nothing calls this directly

Calls 10

performanceMarkFeatureFunction · 0.90
assertAnimationTypesFunction · 0.90
getLViewFunction · 0.90
areAnimationsDisabledFunction · 0.90
getCurrentTNodeFunction · 0.90
addAnimationToLViewFunction · 0.90
getLViewLeaveAnimationsFunction · 0.90
runLeaveAnimationsFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…