Angular material stepper index

547 Views Asked by At

am having a problem on changing a class once i click on the step of a mat-stepper. Does anybody knows how to give a dynamic class once the stepper change index for example ?

2

There are 2 best solutions below

0
On

Edit :

I've got this solution working for me,it was easier then i thought, hope it will helps someone :

 ::ng-deep .mat-step-header[aria-selected="true"]  {
      background-color: var(--primary-color);
    }
0
On

here a demo on stackblitz, it changes the background of the step icon once you click on the stepper.

stepper dynamic change