Validator

export interface Validator

exported from angular2/common defined in angular2/src/common/forms/directives/validators.ts (line 6)

An interface that can be implemented by classes that can act as validators.

Usage

@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}; } }

Members

validate(c:Control) : {[key: string]: any}

Not Yet Documented