HIT THE SWITCH

This commit is contained in:
Max Lynch
2015-05-12 14:18:10 -05:00
parent aadb176a4e
commit 5042426683
5 changed files with 19 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
html {
html, body {
height: 100%;
}

View File

@@ -1,3 +1,4 @@
import {Renderer, ElementRef} from 'angular2/angular2'
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
import {View} from 'angular2/src/core/annotations_impl/view';
@@ -5,7 +6,7 @@ import {IonicComponent} from 'ionic/config/component'
@Component({
selector: 'ion-list, [ion-list]'
selector: 'ion-list'
})
@View({
template: `<content></content>`
@@ -14,8 +15,14 @@ export class List {
constructor() {
}
constructor(
elementRef: ElementRef
) {
this.domElement = elementRef.domElement;
this.config = List.config.invoke(this);
}
}
// new IonicComponent(List, {
// propClasses: ['inset']
// })
new IonicComponent(List, {
propClasses: ['inset']
})

View File

@@ -1,7 +1,7 @@
import {Renderer, ElementRef} from 'angular2/angular2'
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
import {View} from 'angular2/src/core/annotations_impl/view';
import {NgElement, Renderer, ElementRef, DefaultValueAccessor, Ancestor, Optional} from 'angular2/angular2'
import {ControlGroup, ControlDirective} from 'angular2/forms'
import {dom} from 'ionic/util';
import {IonicComponent} from 'ionic/config/component'
@@ -37,14 +37,14 @@ import {IonicComponent} from 'ionic/config/component'
})
export class Switch {
constructor(
@NgElement() element:NgElement,
elementRef: ElementRef,
cd: ControlDirective
// @PropertySetter('attr.role') setAriaRole: Function,
// @PropertySetter('attr.aria-checked') setChecked: Function
// @PropertySetter('attr.aria-invalid') setInvalid: Function,
// @PropertySetter('attr.aria-disabled') setDisabled: Function
) {
this.domElement = element.domElement
this.domElement = elementRef.domElement
this.config = Switch.config.invoke(this)
this.controlDirective = cd;
cd.valueAccessor = this;

View File

@@ -3,12 +3,13 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
import {View} from 'angular2/src/core/annotations_impl/view';
import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms';
import {IONIC_DIRECTIVES} from 'ionic/ionic'
import {Switch, Content, Button, List} from 'ionic/ionic';
//import {IONIC_DIRECTIVES} from 'ionic/ionic'
@Component({ selector: 'ion-app' })
@View({
templateUrl: 'main.html',
directives: [FormDirectives].concat(IONIC_DIRECTIVES)
directives: [FormDirectives].concat([Switch, List, Content, Button])
})
class IonicApp {
constructor() {

View File

@@ -1,10 +1,9 @@
<ion-content>
<form (^submit)="doSubmit($event)" [control-group]="form">
<div class="list-header">Some Switches</div>
<ion-list>
<div class="list-header">Some Switches</div>
<ion-switch control="enableFun">
Enable Fun?
</ion-switch>