linkEmailValidator
npm Package | @angular/forms |
---|---|
Module | import { EmailValidator } from '@angular/forms'; |
Source | forms/src/directives/validators.ts |
linkOverview
@Directive({
selector: '[email][formControlName],[email][formControl],[email][ngModel]',
providers: [EMAIL_VALIDATOR]
})
class EmailValidator implements Validator {
set email: boolean | string
validate(c: AbstractControl): ValidationErrors | null
registerOnValidatorChange(fn: () => void): void
}
linkSelectors
[email][formControlName]
[email][formControl]
[email][ngModel]
linkInputs
email
bound to EmailValidator.email
linkDescription
A Directive that adds the email
validator to controls marked with the
email
attribute, via the NG_VALIDATORS
binding.
linkExample
<input type="email" name="email" ngModel email>
<input type="email" name="email" ngModel email="true">
<input type="email" name="email" ngModel [email]="true">
linkMembers
set email: boolean | string
validate(c: AbstractControl): ValidationErrors | null