This commit is contained in:
Andrew
2015-04-25 11:48:09 -05:00
parent 7b006db118
commit 14ecc7178b
89 changed files with 3470 additions and 435 deletions

View File

@@ -1,7 +1,6 @@
import {Component, View, NgElement, PropertySetter} from 'angular2/angular2'
import {ComponentConfig} from 'ionic/config/component-config'
import {Component, View as NgView, NgElement, PropertySetter} from 'angular2/angular2'
import {IonicComponent} from 'ionic/config/component'
export let SwitchConfig = new ComponentConfig('switch')
@Component({
selector: 'ion-switch',
@@ -10,10 +9,9 @@ export let SwitchConfig = new ComponentConfig('switch')
},
events: {
'click': 'onClick()'
},
injectables: [SwitchConfig]
}
})
@View({
@NgView({
template: `
<div class="item-content">
@@ -29,30 +27,27 @@ export let SwitchConfig = new ComponentConfig('switch')
})
export class Switch {
constructor(
configFactory: SwitchConfig,
element: NgElement,
@PropertySetter('attr.role') setAriaRole: Function,
@PropertySetter('attr.aria-checked') setAriaChecked: Function,
@PropertySetter('attr.aria-invalid') setAriaInvalid: Function,
@PropertySetter('attr.aria-disabled') setAriaDisabled: Function
@PropertySetter('attr.aria-checked') setChecked: Function,
@PropertySetter('attr.aria-invalid') setInvalid: Function,
@PropertySetter('attr.aria-disabled') setDisabled: Function
) {
this.domElement = element.domElement
this.config = Switch.config.invoke(this)
this.domElement.classList.add('item')
this.config = configFactory.create(this)
setAriaRole('checkbox')
setAriaInvalid('false')
setAriaDisabled('false')
setInvalid('false')
setDisabled('false')
this.setAriaRole = setAriaRole
this.setAriaChecked = setAriaChecked
this.setAriaInvalid = setAriaInvalid
this.setAriaDisabled = setAriaDisabled
this.setChecked = setChecked
}
set checked(checked) {
this._checked = checked
this.setAriaChecked(checked)
this.setChecked(checked)
}
get checked() {
return this._checked
@@ -62,3 +57,4 @@ export class Switch {
}
}
new IonicComponent(Switch, {})

View File

@@ -1,5 +1,8 @@
import {Component, View as NgView, bootstrap} from 'angular2/angular2';
import {View, Content, Switch, List} from 'ionic/components';
import {View} from 'ionic/components/view/view';
import {Content} from 'ionic/components/content/content';
import {Switch} from 'ionic/components/switch/switch';
import {List} from 'ionic/components/list/list';
@Component({ selector: '[ion-app]' })
@NgView({