In my endeavors to retrieve the selected step within a component utilizing Angular Material Design stepper, I am encountering some issues.
My current approach involves using the selectedIndex property, but it consistently returns "1" instead of the desired value.
<button mat-button mat-flat-button color="primary"
(click)="onSave(stepper)">
SAVE
</button>
onSave(stepper: MatStepper)
{
debugger;
let workflowStepName = this.declarationWorkflowHelper.getWorkflowName(stepper.selectedIndex);
this.screenSave.next(workflowStepName);
}
Despite my efforts, I consistently receive "1" as the selected index when I actually anticipate a different result.