I'm new to Angular and I searched around but can't find the answer to my question.
I have defined a variable in my class and plan to use it in the template.
public colors = ['red', 'green', 'blue', 'yellow'];
In the template, I have below code:
<div *ngFor="let c of colors; index as i">
<div [style.width]="'100px'" [style.height]="{{(i+1)*10}}px" [style.backgroundColor]="c">{{c}}</div>
</div>
My intention is to calculate the CSS height by the formula (i+1)*10px. The syntax in the upper snippet is not correct. What's the correct way to implement it?