interface Validator { validate(c: AbstractControl) : ValidationErrors| null registerOnValidatorChange(fn: () => void) : void }
An interface that can be implemented by classes that can act as validators.
@Directive({ selector: '[custom-validator]', providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}] }) class CustomValidatorDirective implements Validator { validate(c: Control): {[key: string]: any} { return {"custom": true}; } }
validate(c: AbstractControl) : ValidationErrors|
null
registerOnValidatorChange(fn: () => void) : void
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/Validator-interface.html