fix(forms): match getError and hasError to get method signature (#20211)

Internally getError and hasError call the AbstractControl#get method which takes  `path: Array<string | number> | string` as input, since there are different ways to traverse the AbstractControl tree.
This change matches the method signitures of all methods that use this.

PR Close #20211
This commit is contained in:
Fabian Wiles
2018-12-22 13:39:37 +13:00
committed by Ben Lesh
parent e268a0579a
commit 1b0b36d143
4 changed files with 74 additions and 8 deletions

View File

@ -30,8 +30,8 @@ export declare abstract class AbstractControl {
emitEvent?: boolean;
}): void;
get(path: Array<string | number> | string): AbstractControl | null;
getError(errorCode: string, path?: string[]): any;
hasError(errorCode: string, path?: string[]): boolean;
getError(errorCode: string, path?: Array<string | number> | string): any;
hasError(errorCode: string, path?: Array<string | number> | string): boolean;
markAsDirty(opts?: {
onlySelf?: boolean;
}): void;
@ -80,8 +80,8 @@ export declare abstract class AbstractControlDirective {
readonly valid: boolean | null;
readonly value: any;
readonly valueChanges: Observable<any> | null;
getError(errorCode: string, path?: string[]): any;
hasError(errorCode: string, path?: string[]): boolean;
getError(errorCode: string, path?: Array<string | number> | string): any;
hasError(errorCode: string, path?: Array<string | number> | string): boolean;
reset(value?: any): void;
}