如何订阅这个给定组件的animationend事件?我不能添加更多细节。
@Component({
host: {
'[class.like-popover]' : 'true'
},
selector: 'like-tooltip',
template: `<div @flyInOut="'in'">
<div class="arrow"></div>
<div class="tooltip-inner">{{text}}</div>
</div>`,
styleUrls: ['like-tooltip.component.css'],
animations: [
trigger('flyInOut', [
state('in', style({opacity: 1})),
transition('* => *', [
animate('2s linear', keyframes([
style({opacity: 1, offset: 0}),
style({opacity: 0, transform: 'translate3d(0, -100%, 0)', offset: 1}),
]))
])
])
]})
export class LikeToolTipComponent {
constructor(_elementRef: ElementRef) {
}发布于 2016-09-13 21:28:43
RC.6引入了动画回调,比如:
(@flyInOut.start)="animationStarted($event)"
(@flyInOut.done)="animationDone($event)"#animationStarted(event: AnimationTransitionEvent) {
console.warn('Animation started: ', event);
}
animationDone(event: AnimationTransitionEvent) {
console.warn('Animation done: ', event);
}https://stackoverflow.com/questions/39470925
复制相似问题