Files
Adam Bradley ff0f8ee8f7 input updates
2015-07-17 09:16:00 -05:00

35 lines
946 B
TypeScript

import {Parent, Ancestor, Optional, ElementRef, Attribute, Directive} from 'angular2/angular2';
import {IonInput} from './form';
import {IonicApp} from '../app/app';
import {IonicConfig} from '../../config/config';
import {Content} from '../content/content';
import {Checkbox} from '../checkbox/checkbox';
@Directive({
selector: 'input[type=checkbox],input[type=radio]'
})
export class TapInput extends IonInput {
constructor(
@Optional() @Parent() container: Checkbox, //TODO have this be either Checkbox or Radio
@Optional() @Ancestor() scrollView: Content,
@Attribute('type') type: string,
elementRef: ElementRef,
app: IonicApp,
config: IonicConfig
) {
super(elementRef, app, IonicConfig, scrollView);
if (container) {
container.registerInput(this);
this.container = container;
}
this.type = type;
this.elementRef = elementRef;
this.tabIndex = this.tabIndex || '';
}
}