【发布时间】:2017-02-07 15:21:47
【问题描述】:
如何延迟 *ngFor 的每个项目以逐个设置动画?
我的意思是这样的:
<li *ngFor="let item of items"> //end result like below:
<a [@flyIn]="'in'">first item</a> // delay 100ms and animate
<a [@flyIn]="'in'">first item</a> // delay 200ms and animate
<a [@flyIn]="'in'">first item</a> // delay 300ms and animate
<a [@flyIn]="'in'">first item</a> // delay 400ms and animate
<a [@flyIn]="'in'">first item</a> // delay 500ms and animate
</li>
我是否需要每隔一段时间将项目添加到项目数组中,或者是否有一些更简单的方法?
【问题讨论】:
-
对于这么简单的任务似乎有点复杂,但是谢谢,我会尝试这种方法
-
尝试在窗口属性中设置它,就像这个问题一样:stackoverflow.com/questions/40145581/…
标签: angular angular2-animation