When user navigates from step 4 to step 2 in angular mat stepper I need to disable few buttons in step 2. I am trying to perform something like if selectedIndex = 1 and previous selected index is 3 disable buttons. But is there any way to check the previously selected index is 3 ?!
If(this.stepper.selectedIndex== 1 && previousSelectIndex == 3)
{
// disable buttons
}