Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

EmailValidator

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

See more...

See also

Exported from

Selectors

Properties

Property Description
@Input()
email: boolean | string

Tracks changes to the email attribute bound to this directive.

Description

The email validation is based on the WHATWG HTML specification with some enhancements to incorporate more RFC rules. More information can be found on the Validators.email page.

Adding an email validator

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

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