Change row color in Angular Material table

I assume that you want to apply make-gold class when IsGranted value is true. If this is the case, try this:

<mat-row *matRowDef="let row; columns: displayedColumns;" [ngClass]="{'make-gold': row.IsGranted }">

See also stackblitz demo.

EDIT

There is also a shorthand syntax:

<mat-row ... [class.make-gold]='row.IsGranted' [class.another-class]="true">

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)