I have in my app a matStepper with its 2 first steps that look like this:
<mat-step [stepControl]="actionFormGroup">...</mat-step>
<mat-step [stepControl]="flightsFormGroup">
<form [formGroup]="flightsFormGroup">
<ng-template matStepLabel>Title</ng-template>
<div class="central" fxLayoutGap="20px">
<app-list-flights></app-list-flights>
<div dir="rtl">
<button mat-raised-button color="accent" (click)="checkValidation()">Next</button>
</div>
</div>
</form>
</mat-step>
<mat-step>...</mat-step>
In my typescript, the FormGroup declaration is like this:
export class NewReqComponent implements OnInit {
actionFormGroup: FormGroup;
flightsFormGroup: FormGroup;
ngOnInit() {
this.actionFormGroup = this._formBuilder.group({
ctrl: ['', Validators.required]
});
this.flightsFormGroup = this._formBuilder.group({
ctrl: [false, Validators.requiredTrue]
});
}
}
My form control "ctrl" is modified by a few methods that set it true or false. However, even when it's true, I cannot go to the next step. In the first step, where I only have one input, it works well, as soon as the field is filled I can go to the next step.
Does anyone know where the problem comes from?