I have a material-vertical-stepper in my application, which is shown inside a bootstrap modal. I have used (selectionChange) directive inside mat-vertical-stepper to track the onchange event. But it is not triggered initially. My stepper data is dynamic and steps are listed based on db values. I need to execute a function when the mat stepper is loaded and this need to be executed once. Any help please.
<mat-vertical-stepper [linear]="true" fxLayout="column" fxFlex="100" fxLayoutAlign="stretch" #stepper [selectedIndex]="selectedIndex" (selectionChange)="loadPattern($event)">
<mat-step *ngFor="let template of TemplateArray; let i = index" fxFlex="100" fxLayout="column">
<ng-template matStepLabel>Pattern {{i + 1}} </ng-template>
</mat-step>
</mat-vertical-stepper>