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

Function enterAnimationEnd

packages/core/src/render3/instructions/animation.ts:191–208  ·  view source on GitHub ↗
(
  event: AnimationEvent | TransitionEvent,
  nativeElement: HTMLElement,
  renderer: Renderer,
)

Source from the content-addressed store, hash-verified

189}
190
191function enterAnimationEnd(
192 event: AnimationEvent | TransitionEvent,
193 nativeElement: HTMLElement,
194 renderer: Renderer,
195) {
196 const elementData = enterClassMap.get(nativeElement);
197 // this event.target check is to prevent issues with bubbling events that are from child element animations
198 if (getEventTarget(event) !== nativeElement || !elementData) return;
199 if (isLongestAnimation(event, nativeElement)) {
200 // Now that we've found the longest animation, there's no need
201 // to keep bubbling up this event as it's not going to apply to
202 // other elements further up. We don't want it to inadvertently
203 // affect any other animations on the page.
204 event.stopPropagation();
205 removeClasses(renderer, nativeElement, elementData.classList);
206 cleanupEnterClassData(nativeElement);
207 }
208}
209
210/**
211 * Instruction to handle the `(animate.enter)` behavior for event bindings, aka when

Callers 1

handleEnterAnimationEndFunction · 0.85

Calls 6

getEventTargetFunction · 0.90
isLongestAnimationFunction · 0.90
removeClassesFunction · 0.90
cleanupEnterClassDataFunction · 0.90
stopPropagationMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected