angularionic-framework

Form validation does not update errors Reactive Forms Angular


The email field is required but when filling it in, errors keep appearing under the field:

Email field filled in and with error message

The FormControl associated to the field:

this.dataForm = this.formBuilder.group({
    email: new FormControl('', {
        validators: [ Validators.email, Validators.required ],
        asyncValidators: [ usernameValidator(this.usersService) ],
        // updateOn: 'change',
    })
});

The Email field:

Image of email field HTML

Note: It does not give an error message in either the console or the terminal.


Solution

  • There was a typo. It should be formControlName instead of formcontrolname in home.page.html.