feat(forms): make valueChanges and statusChanges available on abstract control directives

This commit is contained in:
Kara Erickson
2016-06-24 13:37:42 -07:00
parent 83208983b3
commit de127109f9
4 changed files with 26 additions and 2 deletions

View File

@ -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; }
}