checkbox and radio

This commit is contained in:
Tim Lancina
2015-07-17 15:41:01 -05:00
parent 2ed18de699
commit cb5fa23a80
7 changed files with 157 additions and 158 deletions

View File

@ -9,12 +9,18 @@ import {RadioButton} from '../radio/radio';
@Directive({
selector: 'input[type=checkbox],input[type=radio]'
selector: 'input[type=checkbox],input[type=radio]',
properties: [ 'checked', 'name' ],
host: {
'[checked]': 'checked',
'[attr.name]': 'name',
'(change)': 'onChangeEvent($event)'
}
})
export class TapInput extends IonInput {
constructor(
@Optional() @Parent() checkboxContainer: Checkbox, //TODO have this be either Checkbox or Radio
@Optional() @Parent() radioContainer : RadioButton,
@Optional() @Parent() checkboxContainer: Checkbox,
@Optional() @Parent() radioContainer: RadioButton,
@Optional() @Ancestor() scrollView: Content,
@Attribute('type') type: string,
elementRef: ElementRef,
@ -35,4 +41,8 @@ export class TapInput extends IonInput {
this.tabIndex = this.tabIndex || '';
}
onChangeEvent(ev) {
this.container && this.container.onChangeEvent(this);
}
}