diff --git a/src/components/ion.js b/src/components/ion.js index 50dbd64457..b6b9406eac 100644 --- a/src/components/ion.js +++ b/src/components/ion.js @@ -1,11 +1,48 @@ import * as Platform from '../platform'; import * as util from '../util'; -export class Ion { +export class Ion {} - extend(...args) { - args.unshift(this); - return util.extend.apply(null, args); - } +// export class IonElement extends Ion { +// constructor() { -} +// this.children = []; +// } + +// addChild(child) { + +// } +// removeChild(child) { +// } +// insertChild(index, child) { +// } + +// behaviors: Array; +// events: Array; +// } + +// class Behavior { +// } + + + + + + + +// class IonButton extends IonElement { +// text: String; +// type: String; +// } + +// class TabBar extends IonElement { +// tabbuttons: Array + +// onClickTab() { +// let clickedTab = ev.target; + +// } +// } +// class IonTabButton extends IonButton { + +// } diff --git a/src/components/switch/switch.js b/src/components/switch/switch.js index 8d852934d8..f6bf37b6df 100644 --- a/src/components/switch/switch.js +++ b/src/components/switch/switch.js @@ -2,7 +2,10 @@ import {NgElement, Component, Template} from 'angular2/angular2'; import {Ion} from '../ion'; @Component({ - selector: 'ion-switch' + selector: 'ion-switch', + bind: { + checked: 'checked' + } }) @Template({ inline: ` @@ -17,13 +20,53 @@ import {Ion} from '../ion'; ` }) -export class Switch extends Ion { - constructor(@NgElement() el : NgElement) { - this.element = el - console.log('element', el) +export class Switch extends IonElement { + constructor( + @NgElement() el : NgElement, + @EventEmitter('change') emitChange: Function + ) { + this.ngElement = el; + this.emitChange = emitChange; } - onClick(el) { - //el.checked = !el.checked; - console.log(el.checked); + onClick() { + this.emitChange(this.checked); } } + +/* + + +