Angular2 dynamic values in animation

349 views
Skip to first unread message

Tiago Vila Verde

unread,
Jul 29, 2016, 4:25:00 PM7/29/16
to AngularJS

I've just recently started messing around with Ng2

I'm digging into the animation part for the first time and I've ran into some issues.

I have a ngFor that basically repeats divs with different widths. Each element in the array has it's own div's width value which is calculated the component's onInit method. 

Before the animations I was binding the width via [style.width]="expresson". The docs say you can define an animation end state style with '*' which means it'll get the right value from the computed style, but that doesn't work when I'm programatically setting the width myself.

So, question is, how can I tell the animation to either trigger when I change the width, or to dynamically set the value for the end state? Thanks!

Reply all
Reply to author
Forward
0 new messages