import { View, Directive, ElementRef, Host, Optional, NgControl, Renderer, Inject, forwardRef } from 'angular2/angular2'; import {Ion} from '../ion'; import {IonInput} from '../form/input'; import {IonicConfig} from '../../config/config'; import {IonicComponent, IonicView} from '../../config/annotations'; import {pointerCoord} from '../../util/dom'; /** * @name mediaSwitch * @private */ @Directive({ selector: '.media-switch', host: { 'tappable': 'true', '(touchstart)': 'swtch.pointerDown($event)', '(mousedown)': 'swtch.pointerDown($event)', '[class.activated]': 'swtch.isActivated' } }) class MediaSwitch { /** * TODO * @param {Switch} swtch TODO * @param {} elementRef TODO * @param {IonicConfig} config TODO */ constructor( @Host() @Inject(forwardRef(() => Switch)) swtch: Switch, elementRef: ElementRef ) { swtch.switchEle = elementRef.nativeElement; this.swtch = swtch; } } /** * @name ionSwitch * @description * A switch technically is the same thing as an HTML checkbox input, except it looks different and is easier to use on a touch device. Ionic prefers to wrap the checkbox input with the