转换后隐藏元素

Hide element after transition

如何在动画结束后隐藏(从 DOM 中删除 — 就像使用 '*ngIf' 时一样)元素?

这是一些代码:

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

如何在 "inactive" 动画结束后隐藏元素?

看这里:

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

在 "animation callbacks" 上查找信息。在 "yourAnimation.done" 中,您将设置一个回调,然后将您的元素隐藏在那里。