From 504242668318b19b50f83267dcdff66939173702 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Tue, 12 May 2015 14:18:10 -0500 Subject: [PATCH] HIT THE SWITCH --- ionic/components/app/structure.scss | 2 +- ionic/components/list/list.js | 15 +++++++++++---- ionic/components/switch/switch.js | 6 +++--- ionic/components/switch/test/basic/index.js | 5 +++-- ionic/components/switch/test/basic/main.html | 3 +-- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ionic/components/app/structure.scss b/ionic/components/app/structure.scss index 7907c51bbc..e7e8ee19f6 100644 --- a/ionic/components/app/structure.scss +++ b/ionic/components/app/structure.scss @@ -1,4 +1,4 @@ -html { +html, body { height: 100%; } diff --git a/ionic/components/list/list.js b/ionic/components/list/list.js index 976b3a7fe3..91b64410fa 100644 --- a/ionic/components/list/list.js +++ b/ionic/components/list/list.js @@ -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: `` @@ -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'] +}) diff --git a/ionic/components/switch/switch.js b/ionic/components/switch/switch.js index 0fa3c589b7..b6266b561c 100644 --- a/ionic/components/switch/switch.js +++ b/ionic/components/switch/switch.js @@ -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; diff --git a/ionic/components/switch/test/basic/index.js b/ionic/components/switch/test/basic/index.js index 930daf59ba..e024f5c632 100644 --- a/ionic/components/switch/test/basic/index.js +++ b/ionic/components/switch/test/basic/index.js @@ -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() { diff --git a/ionic/components/switch/test/basic/main.html b/ionic/components/switch/test/basic/main.html index b34661d2e2..bdb5c1cb63 100644 --- a/ionic/components/switch/test/basic/main.html +++ b/ionic/components/switch/test/basic/main.html @@ -1,10 +1,9 @@
-
Some Switches
- +
Some Switches
Enable Fun?