( event: AnimationEvent | TransitionEvent, nativeElement: HTMLElement, renderer: Renderer, )
| 166 | } |
| 167 | |
| 168 | function 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 |
no test coverage detected
searching dependent graphs…