Angular2 动画 onDone 回调

问题描述 投票:0回答:2

有人知道如何捕获 Angular2 中新动画系统的

onDone
回调吗?有一个动画 - 我想做一些事情
onDone
...我在 Angular2 的源代码中在
AnimationPlayer
界面看到了这个方法,但没有任何内容暴露给用户...

angular angular-animations
2个回答
1
投票

即将发布的 RC6 版本将通过

(@animation.done)
支持:https://github.com/angular/angular/commit/45e8e73670b96387fc109921fad299742d3f7cbf


0
投票

你尝试过吗

import {AnimationPlayer} from '@angular/core';
constructor(animationPlayer:AnimationPlayer) {
  animationPlayer.onDone(() => {
    console.log('animation done');
  });
}
© www.soinside.com 2019 - 2024. All rights reserved.