You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I created a reactive from with nested FormBuilder, While validate the form i got error like *Property 'controls' does not exist on type 'AbstractControl'. at line editPersonalInfoForm.controls.child.controls.id.hasError('required')".
This is my typescript code
` editPersonalInfoForm: FormGroup;
Hi,
I created a reactive from with nested FormBuilder, While validate the form i got error like *Property 'controls' does not exist on type 'AbstractControl'. at line
editPersonalInfoForm.controls.child.controls.id.hasError('required')"
.This is my typescript code
` editPersonalInfoForm: FormGroup;
constructor(private formBuilder: FormBuilder) { this.editPersonalInfoForm = this.formBuilder.group({ id: ['', [Validators.required]], name: ['', [Validators.minLength(5), Validators.required]], child: this.formBuilder.group({ id: [ '', [Validators.required]], name: [''] }) });
} `
This my html
<form [formGroup]="editPersonalInfoForm" > <input type="text" name="id" formControlName="id"> <input type="text" name="name" formControlName="name"> <small class="error-text" *ngIf="editPersonalInfoForm.controls.name.hasError('maxlength')"> Address Line 1 can't exceed 100 characters. <br> </small> <div formGroupName="child"> <input type="text" name="id" formControlName="id"> <small class="error-text"
Please some one help me
The text was updated successfully, but these errors were encountered: