File

core/forms/emails-validator.directive.ts

Description

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

Example

 * <input type="text" name="emails" ngModel emails>
 * <input type="text" name="emails" ngModel emails="true">
 * <input type="text" name="emails" ngModel [emails]="true">
 *

Implements

Validator

Metadata

Providers { provide: NG_VALIDATORS, useExisting: EmailsValidatorDirective, multi: true }
Selector [emails][formControlName],[emails][formControl],[emails][ngModel]

Index

Methods
Inputs
Accessors

Inputs

emails

Tracks changes to the emails attribute bound to this directive.

Methods

registerOnValidatorChange
registerOnValidatorChange(fn: () => void)

Registers a callback function to call when the validator inputs change.

Parameters :
Name Type Optional
fn function No
Returns : void
validate
validate(control: AbstractControl)

Method that validates whether email addresses are valid. Returns the validation result if enabled, otherwise null.

Parameters :
Name Type Optional
control AbstractControl No
Returns : ValidationErrors | null

Accessors

emails
setemails(value)

Tracks changes to the emails attribute bound to this directive.

Parameters :
Name Optional
value No
Returns : void

result-matching ""

    No results matching ""