I have an array that is being populated in typescript and based on the value in the array, I want to set a different background color for my div but it\'s not working. What
Try ngStyle as follows
[ngStyle]="{'background-color': statusColor[i]}