This reverts commit 6a2e08d0a8
.
This commit is contained in:
@ -18,49 +18,45 @@ import {ValidationErrors} from './validators';
|
||||
* @stable
|
||||
*/
|
||||
export abstract class AbstractControlDirective {
|
||||
abstract get control(): AbstractControl|null;
|
||||
get control(): AbstractControl { throw new Error('unimplemented'); }
|
||||
|
||||
get value(): any { return this.control ? this.control.value : null; }
|
||||
|
||||
get valid(): boolean|null { return this.control ? this.control.valid : null; }
|
||||
get valid(): boolean { return this.control ? this.control.valid : null; }
|
||||
|
||||
get invalid(): boolean|null { return this.control ? this.control.invalid : null; }
|
||||
get invalid(): boolean { return this.control ? this.control.invalid : null; }
|
||||
|
||||
get pending(): boolean|null { return this.control ? this.control.pending : null; }
|
||||
get pending(): boolean { return this.control ? this.control.pending : null; }
|
||||
|
||||
get errors(): ValidationErrors|null { return this.control ? this.control.errors : null; }
|
||||
|
||||
get pristine(): boolean|null { return this.control ? this.control.pristine : null; }
|
||||
get pristine(): boolean { return this.control ? this.control.pristine : null; }
|
||||
|
||||
get dirty(): boolean|null { return this.control ? this.control.dirty : null; }
|
||||
get dirty(): boolean { return this.control ? this.control.dirty : null; }
|
||||
|
||||
get touched(): boolean|null { return this.control ? this.control.touched : null; }
|
||||
get touched(): boolean { return this.control ? this.control.touched : null; }
|
||||
|
||||
get untouched(): boolean|null { return this.control ? this.control.untouched : null; }
|
||||
get untouched(): boolean { return this.control ? this.control.untouched : null; }
|
||||
|
||||
get disabled(): boolean|null { return this.control ? this.control.disabled : null; }
|
||||
get disabled(): boolean { return this.control ? this.control.disabled : null; }
|
||||
|
||||
get enabled(): boolean|null { return this.control ? this.control.enabled : null; }
|
||||
get enabled(): boolean { return this.control ? this.control.enabled : null; }
|
||||
|
||||
get statusChanges(): Observable<any>|null {
|
||||
return this.control ? this.control.statusChanges : null;
|
||||
}
|
||||
get statusChanges(): Observable<any> { return this.control ? this.control.statusChanges : null; }
|
||||
|
||||
get valueChanges(): Observable<any>|null {
|
||||
return this.control ? this.control.valueChanges : null;
|
||||
}
|
||||
get valueChanges(): Observable<any> { return this.control ? this.control.valueChanges : null; }
|
||||
|
||||
get path(): string[]|null { return null; }
|
||||
get path(): string[] { return null; }
|
||||
|
||||
reset(value: any = undefined): void {
|
||||
if (this.control) this.control.reset(value);
|
||||
}
|
||||
|
||||
hasError(errorCode: string, path?: string[]): boolean {
|
||||
hasError(errorCode: string, path: string[] = null): boolean {
|
||||
return this.control ? this.control.hasError(errorCode, path) : false;
|
||||
}
|
||||
|
||||
getError(errorCode: string, path?: string[]): any {
|
||||
getError(errorCode: string, path: string[] = null): any {
|
||||
return this.control ? this.control.getError(errorCode, path) : null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user