{ "id": "api/forms/EmailValidator", "title": "EmailValidator", "contents": "\n\n
\n
\n
\n \n API > @angular/forms\n
\n \n
\n \n
\n

EmailValidatorlink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

A directive that adds the email validator to controls marked with the\nemail attribute. The directive is provided with the NG_VALIDATORS multi-provider list.

\n\n \n
\n \n \n \n \n
\n

See alsolink

\n \n
\n\n\n

NgModuleslink

\n\n\n\n \n
\n

Selectorslink

\n \n \n \n
\n\n\n\n \n\n
\n

Propertieslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
PropertyDescription
\n \n @Input()
email: string | boolean
\n
Write-Only\n \n

Tracks changes to the email attribute bound to this directive.

\n\n \n
\n
\n\n\n\n \n\n\n \n
\n

Descriptionlink

\n \n

Adding an email validatorlink

\n

The following example shows how to add an email validator to an input attached to an ngModel\nbinding.

\n\n<input type=\"email\" name=\"email\" ngModel email>\n<input type=\"email\" name=\"email\" ngModel email=\"true\">\n<input type=\"email\" name=\"email\" ngModel [email]=\"true\">\n\n\n
\n \n\n \n\n \n\n \n\n \n \n \n\n
\n
\n\n\n" }