I need to display dynamic color for a div based on some condition. I am getting console error.
I have tried
<div [ngClass]="{'clr-{{students.rollNo+1}}': students.active}"></div>
students is my array, i have a class called .clr-5, clr-6 etc... in css
try this:
<div [ngClass]="[ students.active ? 'clr-'+students.rollNo+1 : '']"></div>
class bindings are updated in Angular 9. Read more about it here