feat(forms): make valueChanges and statusChanges available on abstract control directives
This commit is contained in:
@ -6,11 +6,13 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Observable} from '../facade/async';
|
||||
import {unimplemented} from '../facade/exceptions';
|
||||
import {isPresent} from '../facade/lang';
|
||||
import {AbstractControl} from '../model';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Base class for control directives.
|
||||
*
|
||||
@ -37,5 +39,13 @@ export abstract class AbstractControlDirective {
|
||||
|
||||
get untouched(): boolean { return isPresent(this.control) ? this.control.untouched : null; }
|
||||
|
||||
get statusChanges(): Observable<any> {
|
||||
return isPresent(this.control) ? this.control.statusChanges : null;
|
||||
}
|
||||
|
||||
get valueChanges(): Observable<any> {
|
||||
return isPresent(this.control) ? this.control.valueChanges : null;
|
||||
}
|
||||
|
||||
get path(): string[] { return null; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user