Open MickL opened 1 year ago
When having a leave animation the start and end animation
Template: <div *ngIf="isVisible" [@fadeOutOnLeave] (@fadeOutOnLeave.done)="animDone($event)"></div>
<div *ngIf="isVisible" [@fadeOutOnLeave] (@fadeOutOnLeave.done)="animDone($event)"></div>
Component:
//... isVisible = false; ngOnInit() { setTimeout(() => { this.isVisble = true; }, 5000); setTimeout(() => { this.isVisble = false; }, 10000); } animDone(event: AnimationEvent) { console.log('Animation Ended', event); }
I would assume that animDone() does only gets called after the div has been faded-out. Instead animDone gets called on init already:
animDone()
animDone
fromState: "void" phaseName: "done" toState: null totalTime: 0
Still the same issue unfortunately, is this project still maintained?
Workaround:
animDone(event: AnimationEvent) { if (event.toState === 'void') { console.log('Animation Ended', event); } }
When having a leave animation the start and end animation
Template:
<div *ngIf="isVisible" [@fadeOutOnLeave] (@fadeOutOnLeave.done)="animDone($event)"></div>
Component:
I would assume that
animDone()
does only gets called after the div has been faded-out. InsteadanimDone
gets called on init already: