I'm getting error of invalid pattern error image in address field as i haven't set any validation on that specific field.
Here is the declaration of formgroup.
this.formGroup = this.fb.group({
id: [''],
firstname: ['', Validators.compose([Validators.required])],
lastname: ['', Validators.compose([Validators.required])],
contactNo: [''],
email: [''],
address: [''],
})
I'm attaching the error picture.
Thank you in advance.
CodePudding user response:
Looks like you are using pattern directive in your HTML.
CodePudding user response:
As i have added pattern in html file like this.
<input name="firstName" ngModel pattern="[a-zA-Z ]*">
So make sure that if you don't pass the validation in the formgroup but still getting error of form validation than check it out on the html side that this type of pattern set or not.
Thanks!!!