Skip to content

Instantly share code, notes, and snippets.

@navix
Created February 11, 2019 11:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save navix/65e3614dfd9beaded4d906da1fae0874 to your computer and use it in GitHub Desktop.
Save navix/65e3614dfd9beaded4d906da1fae0874 to your computer and use it in GitHub Desktop.
Wait for all animations to finish before :leave in Angular 7 (@angular/animations)

Wait for all animations to finish before :leave in Angular 7

Including child components.

@Component({
  ...
  animations: [
    trigger('host', [
      transition(':enter, :leave', [
        query('@*', animateChild(), {optional: true}),
      ]),
    ]),
  ...
})
export class MyComponent {
  @HostBinding('@host') hostTrigger: void;
  ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment