mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
checkbox and radio
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user