feat(forms): add optional controls

This commit is contained in:
vsavkin
2015-02-26 09:31:02 -08:00
parent a73c643322
commit f27e538e2c
7 changed files with 220 additions and 41 deletions
+3 -4
View File
@@ -88,14 +88,13 @@ export class ControlDirective {
_initialize() {
this._groupDecorator.addDirective(this);
if (isPresent(this.validator)) {
var c = this._control();
c.validator = validators.compose([c.validator, this.validator]);
}
var c = this._control();
c.validator = validators.compose([c.validator, this.validator]);
if (isBlank(this.valueAccessor)) {
this.valueAccessor = controlValueAccessorFor(this.type);
}
this._updateDomValue();
DOM.on(this._el.domElement, "change", (_) => this._updateControlValue());
}