mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
tapInput either checkbox or radio
This commit is contained in:
@ -5,6 +5,7 @@ import {IonicApp} from '../app/app';
|
||||
import {IonicConfig} from '../../config/config';
|
||||
import {Content} from '../content/content';
|
||||
import {Checkbox} from '../checkbox/checkbox';
|
||||
import {RadioButton} from '../radio/radio';
|
||||
|
||||
|
||||
@Directive({
|
||||
@ -12,7 +13,8 @@ import {Checkbox} from '../checkbox/checkbox';
|
||||
})
|
||||
export class TapInput extends IonInput {
|
||||
constructor(
|
||||
@Optional() @Parent() container: Checkbox, //TODO have this be either Checkbox or Radio
|
||||
@Optional() @Parent() checkboxContainer: Checkbox, //TODO have this be either Checkbox or Radio
|
||||
@Optional() @Parent() radioContainer : RadioButton,
|
||||
@Optional() @Ancestor() scrollView: Content,
|
||||
@Attribute('type') type: string,
|
||||
elementRef: ElementRef,
|
||||
@ -21,6 +23,8 @@ export class TapInput extends IonInput {
|
||||
) {
|
||||
super(elementRef, app, config, scrollView);
|
||||
|
||||
let container = checkboxContainer || radioContainer;
|
||||
|
||||
if (container) {
|
||||
container.registerInput(this);
|
||||
this.container = container;
|
||||
|
Reference in New Issue
Block a user