我在repo here上有一个悬而未决的问题,但我认为无论如何都要在这里提问.
我想以编程方式从指令中触发动画.使用Renderer.animate时,我得到:
Renderer.animate is no longer supported!
使用Renderer.invokeElementMethod时,我得到:
Cannot read property 'apply' of undefined
我该怎么做?
解决方法:
变化即将来临Angular!请参阅官方Angular回购中的this GitHub issue.
TL; DR
What’s really good: With the first beta of angular 4.1 (which comes out as the follow-up release to this weeks 4.0.0) you can do the following:
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();
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。