fix(inputs): fix form onChange/onTouch

This commit is contained in:
Adam Bradley
2016-01-07 09:22:17 -06:00
parent f74606dc1b
commit 2070e58e3e
3 changed files with 59 additions and 17 deletions

View File

@@ -91,9 +91,6 @@ export class Toggle {
this.lastTouch = 0;
this.mode = config.get('mode');
this.onChange = (_) => {};
this.onTouched = (_) => {};
if (ngControl) {
ngControl.valueAccessor = this;
}
@@ -164,13 +161,6 @@ export class Toggle {
this.onChange(this._checked);
}
/**
* @private
*/
writeValue(value) {
this.checked = value;
}
/**
* @private
*/
@@ -209,6 +199,27 @@ export class Toggle {
this.isActivated = false;
}
/**
* @private
*/
writeValue(value) {
this.checked = value;
}
/**
* @private
*/
onChange(val) {
// TODO: figure the whys and the becauses
}
/**
* @private
*/
onTouched(val) {
// TODO: figure the whys and the becauses
}
/**
* @private
*/
@@ -225,7 +236,7 @@ export class Toggle {
ngOnDestroy() {
this.removeMoveListener();
this.toggleEle = this.addMoveListener = this.removeMoveListener = null;
this.form.deregister(this);
this._form.deregister(this);
}
/**