angularangularjsionic-framework

Form validation does not update errors Reactive Forms Angular


The email field is required and when filling it in, errors continue to appear in the field.

https://stackblitz.com/~/github.com/leandrolopes13/myapp

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

Email field filled in and with error message

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.