首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular 2 RC2 RC2结束

Angular 2 RC2 RC2结束
EN

Stack Overflow用户
提问于 2016-09-13 21:07:43
回答 1查看 408关注 0票数 0

如何订阅这个给定组件的animationend事件?我不能添加更多细节。

代码语言:javascript
复制
@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) {
}

很抱歉重复了:Angular2 Animation onDone callback

EN

回答 1

Stack Overflow用户

发布于 2016-09-13 21:28:43

RC.6引入了动画回调,比如:

代码语言:javascript
复制
(@flyInOut.start)="animationStarted($event)"
(@flyInOut.done)="animationDone($event)"#
代码语言:javascript
复制
animationStarted(event: AnimationTransitionEvent) {
  console.warn('Animation started: ', event);
}

animationDone(event: AnimationTransitionEvent) {
  console.warn('Animation done: ', event);
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39470925

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档