I need to change the background color of the mat-step icon (angular material stepper) based on my array property : etape.etat.
<div *ngFor="let etape of pro.etapes; let i=index">
<mat-step *ngIf="etape.etat == 1" style="background-color: yellow;">
<ng-template matStepLabel> {{ etape.nomEtape }} </ng-template>
</mat-step>
<mat-step *ngIf="etape.etat ==2" style="background-color: green;">
<ng-template matStepLabel> {{ etape.nomEtape }} </ng-template>
</mat-step>
<mat-step *ngIf="etape.etat ==2" style="background-color: red;">
<ng-template matStepLabel> {{ etape.nomEtape }} </ng-template>
</mat-step>
</div>
</mat-horizontal-stepper>
However, the background color is modified only using :
::ng-deep .mat-step-header .mat-step-icon{
background-color: red;
}
Is there any possibility to dynamically change the mat-step icon color based on a condition ?