MCPcopy Create free account
hub / github.com/angular/angular / ɵɵanimateLeave

Function ɵɵanimateLeave

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

Source from the content-addressed store, hash-verified

273 * @codeGenApi
274 */
275export function ɵɵanimateLeave(value: string | AnimationClassBindingFn): typeof ɵɵanimateLeave {
276 performanceMarkFeature('NgAnimateLeave');
277
278 if ((typeof ngServerMode !== 'undefined' && ngServerMode) || !areAnimationSupported) {
279 return ɵɵanimateLeave;
280 }
281
282 ngDevMode && assertAnimationTypes(value, 'animate.leave');
283
284 const lView = getLView();
285 const animationsDisabled = areAnimationsDisabled(lView);
286 if (animationsDisabled) {
287 return ɵɵanimateLeave;
288 }
289
290 const tNode = getCurrentTNode()!;
291
292 // Capture NgZone eagerly while the injector is still valid. The animation
293 // function runs later from the queue, at which point the lView injector
294 // may have been destroyed.
295 const ngZone = lView[INJECTOR]!.get(NgZone);
296
297 enableAnimationRuntimeSupport();
298 enableViewDetachAnimationsSupport();
299
300 addAnimationToLView(getLViewLeaveAnimations(lView), tNode, () =>
301 runLeaveAnimations(lView, tNode, value, ngZone),
302 );
303
304 initializeAnimationQueueScheduler(lView[INJECTOR]);
305
306 return ɵɵanimateLeave; // For chaining
307}
308
309function runLeaveAnimations(
310 lView: LView,

Callers

nothing calls this directly

Calls 12

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