【发布时间】:2017-06-17 10:14:00
【问题描述】:
我正在尝试制作一个简单的动画,就像下面的简单 jQuery 一样
animate({'left' : left_indent})
我正在使用 Angular2 动画,但问题是如何将组件类外部的 left_indent 参数传递给动画触发器?
animations: [
trigger('flyInOut', [
state('for', style({
left: this.left_indent,
})),
transition('* => for', [
animate(2000, keyframes([
style({ opacity: 1, transform: 'translateX(0)', offset: 0 }),
style({ opacity: 1, transform: 'translateX(-300px)', offset: 0.5 }),
]))
]),
])
]
【问题讨论】:
标签: angular angular-animations