I have an Angular Material Stepper component with a fixed amount of steps. I want to be able to hide steps depending on whether a condition is true or false.
I first tried this by using the *ngif
directive, and it worked just fine until I realized that it removes those steps from the stepper array. This is not good as I need the stepper array to match with an array in my back end logic.
So instead of removing the steps from the DOM completely, I decided to just throw a [hidden]="!myCondition"
on the <mat-step>
. This does not work. It never will hide the steps, as the steps inherit display: block;
from the <mat-vertical-stepper>
Is there any way to overwrite this behavior without completely hiding the whole Stepper? Or is there an alternative way to accomplish this?