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

Function enterAnimationEnd

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

Source from the content-addressed store, hash-verified

166}
167
168function enterAnimationEnd(
169 event: AnimationEvent | TransitionEvent,
170 nativeElement: HTMLElement,
171 renderer: Renderer,
172) {
173 const elementData = enterClassMap.get(nativeElement);
174 // this event.target check is to prevent issues with bubbling events that are from child element animations
175 if (getEventTarget(event) !== nativeElement || !elementData) return;
176 if (isLongestAnimation(event, nativeElement)) {
177 // Now that we've found the longest animation, there's no need
178 // to keep bubbling up this event as it's not going to apply to
179 // other elements further up. We don't want it to inadvertently
180 // affect any other animations on the page.
181 event.stopPropagation();
182 for (const klass of elementData.classList) {
183 renderer.removeClass(nativeElement, klass);
184 }
185 cleanupEnterClassData(nativeElement);
186 }
187}
188
189/**
190 * 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
cleanupEnterClassDataFunction · 0.90
stopPropagationMethod · 0.80
getMethod · 0.65
removeClassMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…