1// I personally do this in ngAfterViewInit() method
2setTimeout(() => {
3 this.stepper.steps.forEach((step, idx) => {
4 step.select = () => {
5 // Your custom code here
6 // if you want to change step do execute code below
7 this.selectedStepIndex = idx;
8 };
9 });
10});
11
1<mat-horizontal-stepper [selectedIndex]="selectedStepIndex" #stepper>
2