@@ -18,45 +18,49 @@ import {ValidationErrors} from './validators';
1818 * @stable
1919 */
2020export abstract class AbstractControlDirective {
21- get control ( ) : AbstractControl { throw new Error ( 'unimplemented' ) ; }
21+ abstract get control ( ) : AbstractControl | null ;
2222
2323 get value ( ) : any { return this . control ? this . control . value : null ; }
2424
25- get valid ( ) : boolean { return this . control ? this . control . valid : null ; }
25+ get valid ( ) : boolean | null { return this . control ? this . control . valid : null ; }
2626
27- get invalid ( ) : boolean { return this . control ? this . control . invalid : null ; }
27+ get invalid ( ) : boolean | null { return this . control ? this . control . invalid : null ; }
2828
29- get pending ( ) : boolean { return this . control ? this . control . pending : null ; }
29+ get pending ( ) : boolean | null { return this . control ? this . control . pending : null ; }
3030
3131 get errors ( ) : ValidationErrors | null { return this . control ? this . control . errors : null ; }
3232
33- get pristine ( ) : boolean { return this . control ? this . control . pristine : null ; }
33+ get pristine ( ) : boolean | null { return this . control ? this . control . pristine : null ; }
3434
35- get dirty ( ) : boolean { return this . control ? this . control . dirty : null ; }
35+ get dirty ( ) : boolean | null { return this . control ? this . control . dirty : null ; }
3636
37- get touched ( ) : boolean { return this . control ? this . control . touched : null ; }
37+ get touched ( ) : boolean | null { return this . control ? this . control . touched : null ; }
3838
39- get untouched ( ) : boolean { return this . control ? this . control . untouched : null ; }
39+ get untouched ( ) : boolean | null { return this . control ? this . control . untouched : null ; }
4040
41- get disabled ( ) : boolean { return this . control ? this . control . disabled : null ; }
41+ get disabled ( ) : boolean | null { return this . control ? this . control . disabled : null ; }
4242
43- get enabled ( ) : boolean { return this . control ? this . control . enabled : null ; }
43+ get enabled ( ) : boolean | null { return this . control ? this . control . enabled : null ; }
4444
45- get statusChanges ( ) : Observable < any > { return this . control ? this . control . statusChanges : null ; }
45+ get statusChanges ( ) : Observable < any > | null {
46+ return this . control ? this . control . statusChanges : null ;
47+ }
4648
47- get valueChanges ( ) : Observable < any > { return this . control ? this . control . valueChanges : null ; }
49+ get valueChanges ( ) : Observable < any > | null {
50+ return this . control ? this . control . valueChanges : null ;
51+ }
4852
49- get path ( ) : string [ ] { return null ; }
53+ get path ( ) : string [ ] | null { return null ; }
5054
5155 reset ( value : any = undefined ) : void {
5256 if ( this . control ) this . control . reset ( value ) ;
5357 }
5458
55- hasError ( errorCode : string , path : string [ ] = null ) : boolean {
59+ hasError ( errorCode : string , path ? : string [ ] ) : boolean {
5660 return this . control ? this . control . hasError ( errorCode , path ) : false ;
5761 }
5862
59- getError ( errorCode : string , path : string [ ] = null ) : any {
63+ getError ( errorCode : string , path ? : string [ ] ) : any {
6064 return this . control ? this . control . getError ( errorCode , path ) : null ;
6165 }
6266}
0 commit comments