fix(forms): update validity when validator dir changes

closes #11116
This commit is contained in:
Kara Erickson
2016-08-29 11:33:49 -07:00
committed by Victor Berchet
parent 0b665c0ece
commit d2ad871279
12 changed files with 324 additions and 44 deletions

View File

@ -253,6 +253,12 @@ export abstract class AbstractControl {
}
}
/** @internal */
_updateTreeValidity({emitEvent}: {emitEvent?: boolean} = {emitEvent: true}) {
this._forEachChild((ctrl: AbstractControl) => ctrl._updateTreeValidity({emitEvent}));
this.updateValueAndValidity({onlySelf: true, emitEvent});
}
private _runValidator(): {[key: string]: any} {
return isPresent(this.validator) ? this.validator(this) : null;
}