I have the following mat-checkbox:
<mat-checkbox formControlName="formControlIdentificador" color="primary" class="correcaoClasseCheck" labelPosition="before"></mat-checkbox>
<input formControlName="formControlNomeIdentificador" matInput placeholder="Qual era o nome no identificador?">
The second input (formControlNameName) should be required if the checkbox is selected. How can I do this?
This is my form builder:
this.secondFormGroup = this._formBuilder.group({
formControlIdentificador: new FormControl('', [
]),
formControlNomeIdentificador: new FormControl('', [
])
});