Is there any way in angular, html or css to dynamically apply CSS based on object value:
HTML:
<mat-grid-tile *ngFor="let obj of objs">
<span class="(value according to variable)">
{{ obj.n }}
</span>
</mat-grid-tile>
CSS:
.first {
color: #db4437;
}
.second {
color: #32cd32;
}
What I want to do is, if obj.n is red, I want first as the class of span tag and second => otherwise