tapInput either checkbox or radio

This commit is contained in:
Tim Lancina
2015-07-17 09:51:02 -05:00
parent 63c1773a09
commit aa662eda9a

View File

@ -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;