feat(forms): support updating of validators on exiting controls (#9516)

lint

fix

async

d

test

test
This commit is contained in:
Torgeir Helgevold
2016-06-23 11:18:07 -04:00
committed by Victor Berchet
parent 098b461b69
commit 638fd744aa
2 changed files with 95 additions and 0 deletions

View File

@ -100,6 +100,18 @@ export abstract class AbstractControl {
get pending(): boolean { return this._status == PENDING; }
setAsyncValidators(newValidator: AsyncValidatorFn|AsyncValidatorFn[]): void {
this.asyncValidator = coerceToAsyncValidator(newValidator);
}
clearAsyncValidators(): void { this.asyncValidator = null; }
setValidators(newValidator: ValidatorFn|ValidatorFn[]): void {
this.validator = coerceToValidator(newValidator);
}
clearValidators(): void { this.validator = null; }
markAsTouched(): void { this._touched = true; }
markAsDirty({onlySelf}: {onlySelf?: boolean} = {}): void {