I have a total of 8 step form. I have used stepper form for this in register.html
with isLinear=true
in register.ts
file. Now, these 8 steps are coming from steps module which having 8 different step form.
Actually when I used the step form like in doc.
it works fine for me.
But when I tried to call the content of <mat-form-field>
from steps form then it is giving me an issue of mat-form-field must contain a MatFormFieldControl
. I understood this issue. Now I am stuck at :
How can I use the different step forms under the <mat-form-field>
(steps forms are coming from steps folder) with the isLinear = true
.
Here is my code:
<mat-horizontal-stepper [linear]="isLinear" #stepper>
<mat-step [stepControl]="firstFormGroup">
<form [formGroup]="firstFormGroup">
<ng-template matStepLabel>Fill out your name</ng-template>
<mat-form-field>
<steponeForm></steponeForm>// For this its givng me error of mat-form-field must contain a MatFormFieldControl although under steponeForm.html its define
</mat-form-field>
<div>
<button mat-button matStepperNext>Next</button>
</div>
</form>
</mat-step>
<mat-step [stepControl]="firstFormGroup">
<form [formGroup]="firstFormGroup">
<ng-template matStepLabel>Fill out your name</ng-template>
<mat-form-field>
<steptwoForm></steptwoForm> // For this its givng me error of mat-form-field must contain a MatFormFieldControl although under steptwoForm.html its define
</mat-form-field>
<div>
<button mat-button matStepperNext>Next</button>
</div>
</form>
</mat-step>