From d41d2c460a48e2cd866f2874e611fca266e606a0 Mon Sep 17 00:00:00 2001 From: Fabian Wiles Date: Fri, 10 Nov 2017 21:09:22 +1300 Subject: [PATCH] feat(forms): allow nulls on setAsyncValidators (#20327) closes #20296 PR Close #20327 --- packages/forms/src/model.ts | 2 +- tools/public_api_guard/forms/forms.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/forms/src/model.ts b/packages/forms/src/model.ts index 348898318f..4c087022fd 100644 --- a/packages/forms/src/model.ts +++ b/packages/forms/src/model.ts @@ -253,7 +253,7 @@ export abstract class AbstractControl { * Sets the async validators that are active on this control. Calling this * will overwrite any existing async validators. */ - setAsyncValidators(newValidator: AsyncValidatorFn|AsyncValidatorFn[]): void { + setAsyncValidators(newValidator: AsyncValidatorFn|AsyncValidatorFn[]|null): void { this.asyncValidator = coerceToAsyncValidator(newValidator); } diff --git a/tools/public_api_guard/forms/forms.d.ts b/tools/public_api_guard/forms/forms.d.ts index 7a478b028a..cb797f5285 100644 --- a/tools/public_api_guard/forms/forms.d.ts +++ b/tools/public_api_guard/forms/forms.d.ts @@ -50,7 +50,7 @@ export declare abstract class AbstractControl { }): void; abstract patchValue(value: any, options?: Object): void; abstract reset(value?: any, options?: Object): void; - setAsyncValidators(newValidator: AsyncValidatorFn | AsyncValidatorFn[]): void; + setAsyncValidators(newValidator: AsyncValidatorFn | AsyncValidatorFn[] | null): void; setErrors(errors: ValidationErrors | null, opts?: { emitEvent?: boolean; }): void;