NetanelBasal
7/23/2018 - 2:49 PM

snackbar-3.ts

@Component({
  template: `
   <div class="snackbar-container"
     (animationend)="animationDone($event)">
     {{ content }} <button (click)="close()">&#x2715;</button>
   </div>
  `
})
export class SnackbarComponent {
  ..
  @Output() afterClose = new EventEmitter();

  animationDone(event: AnimationEvent) {
    if (event.animationName === 'snackbarOut') {
      this.afterClose.emit(true);
    }
  }
  ...
}