最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - What is the function of the stepControl property on mat-step directives? - Stack Overflow

matteradmin7PV0评论

On the Angular Material stepper there is a stepControl property on each mat-step that contains a form. What does the stepControl property do?

<mat-step [stepControl]="registrationForm">

It seems like the function would be to disallow moving to the next step if the form is not valid, but just wanted to double check.

On the Angular Material stepper there is a stepControl property on each mat-step that contains a form. What does the stepControl property do?

<mat-step [stepControl]="registrationForm">

It seems like the function would be to disallow moving to the next step if the form is not valid, but just wanted to double check.

Share Improve this question asked Feb 10, 2022 at 14:18 OleOle 47.6k70 gold badges238 silver badges447 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Correct, however, if any form validation is not pulsory you can use the isOptional property to ignore that form's validity and proceed to the next step.

<mat-step [stepControl]="registrationForm" [optional]="isOptional">

Similarly if you are not using Reactive Forms you can use another property called pleted to allow the user to proceed to the next step only if pleted is true

<mat-step [pleted]="isCompleted">
Post a comment

comment list (0)

  1. No comments so far