checkbox updates

This commit is contained in:
Adam Bradley
2015-07-31 18:22:38 -05:00
parent b89f383ecc
commit 5db5c41809
6 changed files with 49 additions and 80 deletions

View File

@ -10,12 +10,15 @@ import {RadioButton} from '../radio/radio';
@Directive({
selector: 'input[type=checkbox],input[type=radio]',
properties: [ 'checked', 'name', 'value' ],
properties: [
'checked',
'name',
'value'
],
host: {
'[checked]': 'checked',
'[value]': 'value',
'[attr.name]': 'name',
'(change)': 'toggle()',
'class': 'tap-input input'
}
})
@ -43,15 +46,4 @@ export class TapInput extends IonInput {
this.tabIndex = this.tabIndex || '';
}
onInit() {
console.log("tapinput oninit, " + this.id + " checked: " + this.checked);
console.log("tapinput oninit, " + this.id + " value: " + this.value);
}
//to detect switching/selecting inputs with the keyboard
//view -> model (Control)
toggle() {
this.container && this.container.toggle(this);
}
}