Reputation: 12179
How can I set an element's left position to an iteree's value in a loop?
<div *ngFor="let label of labels" style="left: {{label.position}};">
{{label.label}}
</div>
I've tried the braces but that doesn't work.
Upvotes: 0
Views: 948
Reputation: 71911
You can use the [style]
binding:
<div *ngFor="let label of labels" [style.left.px]="label.position">
{{label.label}}
</div>
Upvotes: 3