W3cubDocs

/Angular 4 TypeScript

EmailValidator

Experimental Directive

Class Overview

class EmailValidator implements Validator {
  email 
  validate(c: AbstractControl) : ValidationErrors|
}

Selectors

[email][formControlName]

[email][formControl]

[email][ngModel]

Class Description

A Directive that adds the email validator to controls marked with the email attribute, via the NG_VALIDATORS binding.

Example

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

Class Details

email
validate(c: AbstractControl) : ValidationErrors|

exported from forms/index, defined in forms/src/directives/validators.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/docs/ts/latest/api/forms/index/EmailValidator-directive.html