mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +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 {IonicConfig} from '../../config/config';
|
||||||
import {Content} from '../content/content';
|
import {Content} from '../content/content';
|
||||||
import {Checkbox} from '../checkbox/checkbox';
|
import {Checkbox} from '../checkbox/checkbox';
|
||||||
|
import {RadioButton} from '../radio/radio';
|
||||||
|
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
@ -12,7 +13,8 @@ import {Checkbox} from '../checkbox/checkbox';
|
|||||||
})
|
})
|
||||||
export class TapInput extends IonInput {
|
export class TapInput extends IonInput {
|
||||||
constructor(
|
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,
|
@Optional() @Ancestor() scrollView: Content,
|
||||||
@Attribute('type') type: string,
|
@Attribute('type') type: string,
|
||||||
elementRef: ElementRef,
|
elementRef: ElementRef,
|
||||||
@ -21,6 +23,8 @@ export class TapInput extends IonInput {
|
|||||||
) {
|
) {
|
||||||
super(elementRef, app, config, scrollView);
|
super(elementRef, app, config, scrollView);
|
||||||
|
|
||||||
|
let container = checkboxContainer || radioContainer;
|
||||||
|
|
||||||
if (container) {
|
if (container) {
|
||||||
container.registerInput(this);
|
container.registerInput(this);
|
||||||
this.container = container;
|
this.container = container;
|
||||||
|
Reference in New Issue
Block a user