I found several hacking solutions for this. The problem is that you cannot completely disable header navigation, but you can prevent it from being activated until a certain point.
And this moment is form.invalid .
My situation was the following: the user needs to fill out the form inside the step, click "save" and only after that use the NEXT button and move further along the step (also back).
What I did was enter another hidden input that will use the dynamic attribute angular [required] . This will only be required if the previous save condition was not successful. Once this happens, this field will not be required and the user will be able to move on.
Together with the mat-stepper (or md-stepper) editable attribute, you can achieve what you want.
Let me know if you fully understood this idea.
source share