我在这里的 repo 上有一个未决的问题,但我认为无论如何在这里问它会很有用。
我想以编程方式从指令中触发动画。使用时Renderer.animate
,我得到:
Renderer.animate is no longer supported!
使用时Renderer.invokeElementMethod
,我得到:
Cannot read property 'apply' of undefined
我该怎么做?
我在这里的 repo 上有一个未决的问题,但我认为无论如何在这里问它会很有用。
我想以编程方式从指令中触发动画。使用时Renderer.animate
,我得到:
Renderer.animate is no longer supported!
使用时Renderer.invokeElementMethod
,我得到:
Cannot read property 'apply' of undefined
我该怎么做?
Angular 即将发生变化!在官方 Angular 存储库中查看这个 GitHub 问题。
TL;博士
真正的好处:使用 Angular 4.1 的第一个测试版(作为本周 4.0.0 的后续版本发布),您可以执行以下操作:
class MyCmp {
constructor(private _builder: AnimationBuilder) {
}
myMethod() {
const animation = this._builder.build([
style(...),
animate(...),
group([
animate(...)
animate(...)
animate(...)
])
]);
const player = animation.create(someElement);
player.play();
}
}