Hi, I’m testing ngClass in a project, so that an ion-item changes color based on a numeric value, this is the HTML code
<ng-container *ngFor="let player of team1">
<ion-item [ngClass]="{'rBG': player.Susp > 0}">
<ion-label slot="start" (click)="presentAlert()">{{player.Name}} {{player.Surn1}} {{player.Surn2}} {{player.Num}}</ion-label>
<ion-checkbox slot="end"></ion-checkbox>
</ion-item>
</ng-container>
Here is my SCSS code:
.rGB{
color: red;
}
player.Susp holds a numeric value obtained from a database