UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

33 lines 1.49 kB
import { AbstractControl, ValidationErrors, Validator } from '@angular/forms'; import * as i0 from "@angular/core"; /** * 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. * * ```html * <input type="text" name="emails" ngModel emails> * <input type="text" name="emails" ngModel emails="true"> * <input type="text" name="emails" ngModel [emails]="true"> * ``` */ export declare class EmailsValidatorDirective implements Validator { private _enabled; private _onChange?; private separator; /** * Tracks changes to the emails attribute bound to this directive. */ set emails(value: boolean | string); /** * Method that validates whether email addresses are valid. * Returns the validation result if enabled, otherwise null. */ validate(control: AbstractControl): ValidationErrors | null; /** * Registers a callback function to call when the validator inputs change. */ registerOnValidatorChange(fn: () => void): void; static ɵfac: i0.ɵɵFactoryDeclaration<EmailsValidatorDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<EmailsValidatorDirective, "[emails][formControlName],[emails][formControl],[emails][ngModel]", never, { "emails": { "alias": "emails"; "required": false; }; }, {}, never, never, true, never>; } //# sourceMappingURL=emails-validator.directive.d.ts.map