form: FormGroup;
createMyForm() {
this.form = new FormGroup<any>({
firstName: new FormControl<any>('', [Validators.required]),
lastName: new FormControl<any>('', { nonNullable: true }),
});
}
How to add { nonNullable: true } to firstName
I am trying to add {nonNullable: true } to the form control.
lastName: new FormControl('', { nonNullable: true }),
I am able to add {nonNullable: true } to the control which doesnt have validations, but for the form control which has validations I am not able to add {nonNullable: true }.
firstName: new FormControl('', [Validators.required]),