Hide element after transition

2.3k Views Asked by At

How do you hide(remove from DOM — like when using '*ngIf') element after animation ends?

Here's some code:

 state('inactive', style({
   backgroundColor: '#eee',
   transform: 'scale(1)'
 })),
 state('active',   style({
   backgroundColor: '#cfd8dc',
   transform: 'scale(1.1)'
 })),

How do I hide element after "inactive" animation ends?

1

There are 1 best solutions below

0
On BEST ANSWER

Take a look here:

https://angular.io/docs/ts/latest/guide/animations.html#!#animation-callbacks

Look for the info on "animation callbacks". In "yourAnimation.done", you'd set up a callback, then hide your element there.