* Thank you for choosing the Awesome App!
*
diff --git a/ionic/components/slides/test/basic/main.html b/ionic/components/slides/test/basic/main.html
index d93835abfe..e9cad308ac 100644
--- a/ionic/components/slides/test/basic/main.html
+++ b/ionic/components/slides/test/basic/main.html
@@ -1,5 +1,5 @@
-
+
diff --git a/ionic/components/slides/test/intro/main.html b/ionic/components/slides/test/intro/main.html
index 00caad1bb2..53baf00e2c 100644
--- a/ionic/components/slides/test/intro/main.html
+++ b/ionic/components/slides/test/intro/main.html
@@ -42,7 +42,7 @@
Grid Icons
-
+
Thank you for choosing the Awesome App!
diff --git a/ionic/components/slides/test/loop/index.ts b/ionic/components/slides/test/loop/index.ts
new file mode 100644
index 0000000000..cd4956465e
--- /dev/null
+++ b/ionic/components/slides/test/loop/index.ts
@@ -0,0 +1,37 @@
+import {App, IonicApp} from 'ionic/ionic';
+
+@App({
+ templateUrl: 'main.html'
+})
+class MyApp {
+ constructor(app: IonicApp) {
+ this.app = app;
+
+ this.slides = [
+ {
+ name: "Slide 1",
+ class: "yellow"
+ },
+ {
+ name: "Slide 2",
+ class: "red"
+ },
+ {
+ name: "Slide 3",
+ class: "blue"
+ }
+ ];
+ }
+
+ onSlideChanged(slider) {
+ console.log('Slide changed', slider);
+ console.log("active index", slider.activeIndex);
+ }
+
+ ngOnInit() {
+ setTimeout(() => {
+ this.slider = this.app.getComponent('loopSlider');
+ console.log('Got slider', this.slider);
+ });
+ }
+}
diff --git a/ionic/components/slides/test/loop/main.html b/ionic/components/slides/test/loop/main.html
new file mode 100644
index 0000000000..625d492e7b
--- /dev/null
+++ b/ionic/components/slides/test/loop/main.html
@@ -0,0 +1,19 @@
+
+
+ {{ slide.name }}
+
+
+
+
diff --git a/ionic/components/slides/test/scroll/index.ts b/ionic/components/slides/test/scroll/index.ts
index d35afbe1b4..edfdcec9b6 100644
--- a/ionic/components/slides/test/scroll/index.ts
+++ b/ionic/components/slides/test/scroll/index.ts
@@ -1,5 +1,4 @@
import {App} from 'ionic/ionic';
-import {NgIf} from 'angular/angular';
@App({
templateUrl: 'main.html',
diff --git a/ionic/components/slides/test/scroll/main.html b/ionic/components/slides/test/scroll/main.html
index 14c8d38498..2ab57c8cce 100644
--- a/ionic/components/slides/test/scroll/main.html
+++ b/ionic/components/slides/test/scroll/main.html
@@ -12,7 +12,7 @@
-
diff --git a/ionic/components/switch/switch.ios.scss b/ionic/components/switch/switch.ios.scss
deleted file mode 100644
index 81e783bb9f..0000000000
--- a/ionic/components/switch/switch.ios.scss
+++ /dev/null
@@ -1,184 +0,0 @@
-@import "../../globals.ios";
-
-// iOS Switch
-// --------------------------------------------------
-
-$switch-ios-width: 51px !default;
-$switch-ios-height: 32px !default;
-$switch-ios-border-width: 2px !default;
-$switch-ios-border-radius: $switch-ios-height / 2 !default;
-
-$switch-ios-background-color-off: $list-ios-background-color !default;
-$switch-ios-border-color-off: grayscale(lighten($list-ios-border-color, 11%)) !default;
-
-$switch-ios-background-color-on: map-get($colors-ios, primary) !default;
-
-$switch-ios-handle-width: $switch-ios-height - ($switch-ios-border-width * 2) !default;
-$switch-ios-handle-height: $switch-ios-handle-width !default;
-$switch-ios-handle-border-radius: $switch-ios-handle-height / 2 !default;
-$switch-ios-handle-box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16), 0 3px 1px rgba(0, 0, 0, 0.1) !default;
-
-$switch-ios-handle-background-color: $switch-ios-background-color-off !default;
-
-$switch-ios-media-margin: 0 !default;
-$switch-ios-media-padding: 6px ($item-ios-padding-right / 2) 5px ($item-ios-padding-left) !default;
-
-$switch-ios-transition-duration: 300ms !default;
-
-$switch-ios-disabled-opacity: 0.5 !default;
-$switch-ios-disabled-text-color: $subdued-text-ios-color !default;
-
-
-// Switch
-// -----------------------------------------
-
-ion-switch {
- display: block;
- @include user-select-none();
-
- &.item.activated {
- background: $list-ios-background-color;
- }
-}
-
-
-// Switch Wrapper
-// -----------------------------------------
-
-.switch-media {
- margin: $switch-ios-media-margin;
- padding: $switch-ios-media-padding;
- cursor: pointer;
-}
-
-
-// Switch Background Track
-// -----------------------------------------
-
-.switch-icon {
- // bg track, when not checked
- position: relative;
- display: block;
- width: $switch-ios-width;
- height: $switch-ios-height;
- border-radius: $switch-ios-border-radius;
- pointer-events: none;
-
- background-color: $switch-ios-border-color-off;
- transition: background-color $switch-ios-transition-duration;
-}
-
-
-// Switch Background Track, Inner Oval
-// -----------------------------------------
-
-.switch-icon:before {
- // inner bg track's oval, when not checked
- content: '';
- position: absolute;
- top: $switch-ios-border-width;
- right: $switch-ios-border-width;
- left: $switch-ios-border-width;
- bottom: $switch-ios-border-width;
-
- border-radius: $switch-ios-border-radius;
- background-color: $switch-ios-background-color-off;
-
- transform: scale3d(1, 1, 1);
- transition: transform $switch-ios-transition-duration;
-}
-
-
-// Switch Knob
-// -----------------------------------------
-
-.switch-icon:after {
- // knob, when not checked
- content: '';
- position: absolute;
- top: $switch-ios-border-width;
- left: $switch-ios-border-width;
-
- width: $switch-ios-handle-width;
- height: $switch-ios-handle-height;
-
- border-radius: $switch-ios-handle-border-radius;
- background-color: $switch-ios-handle-background-color;
- box-shadow: $switch-ios-handle-box-shadow;
-
- transition: transform $switch-ios-transition-duration, width 120ms ease-in-out 80ms, left 110ms ease-in-out 80ms;
-}
-
-
-// Switch Checked
-// -----------------------------------------
-
-ion-switch[aria-checked=true] {
- .switch-icon {
- // bg track, when checked
- background-color: $switch-ios-background-color-on;
-
- &:before {
- // inner bg track's oval, when checked
- transform: scale3d(0, 0, 0);
- }
-
- &:after {
- // knob, when checked
- transform: translate3d($switch-ios-width - $switch-ios-handle-width - ($switch-ios-border-width * 2), 0, 0);
- }
- }
-
- .switch-activated .switch-icon {
- &:before {
- // inner bg track's oval, when checked
- transform: scale3d(0, 0, 0);
- }
-
- &:after {
- // when pressing down on the switch and IS checked
- // make the knob wider and move it left a bit
- left: $switch-ios-border-width - 6;
-
- // when pressing down on the switch and NOT checked
- // then make the knob wider
- width: $switch-ios-handle-width + 6;
- }
- }
-}
-
-
-// Switch Disabled
-// -----------------------------------------
-
-ion-switch[aria-disabled=true] {
- opacity: $switch-ios-disabled-opacity;
- color: $switch-ios-disabled-text-color;
- pointer-events: none;
-}
-
-
-// iOS Switch Color Mixin
-// --------------------------------------------------
-
-@mixin switch-theme-ios($color-name, $bg-on) {
-
- ion-switch[#{$color-name}] {
-
- &[aria-checked=true] .switch-icon {
- background-color: $bg-on;
- }
-
- }
-
-}
-
-
-// Generate iOS Switch Auxiliary Colors
-// --------------------------------------------------
-
-@each $color-name, $value in $colors-ios {
-
- @include switch-theme-ios($color-name, $value);
-
-}
diff --git a/ionic/components/switch/switch.md.scss b/ionic/components/switch/switch.md.scss
deleted file mode 100644
index 4200de3b3c..0000000000
--- a/ionic/components/switch/switch.md.scss
+++ /dev/null
@@ -1,140 +0,0 @@
-@import "../../globals.md";
-
-// Material Design Switch
-// --------------------------------------------------
-
-$switch-md-active-color: map-get($colors-md, primary) !default;
-
-$switch-md-track-width: 36px !default;
-$switch-md-track-height: 14px !default;
-$switch-md-track-background-color-off: $list-md-border-color !default;
-$switch-md-track-background-color-on: lighten($switch-md-active-color, 25%) !default;
-
-$switch-md-handle-width: 20px !default;
-$switch-md-handle-height: 20px !default;
-$switch-md-handle-background-color-off: $background-md-color !default;
-$switch-md-handle-background-color-on: $switch-md-active-color !default;
-$switch-md-handle-box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12) !default;
-$switch-md-handle-border-radius: 50% !default;
-
-$switch-md-media-margin: 0 !default;
-$switch-md-media-padding: 12px ($item-md-padding-right / 2) 12px $item-md-padding-left !default;
-
-$switch-md-transition-duration: 300ms !default;
-
-$switch-md-disabled-opacity: 0.5 !default;
-$switch-md-disabled-text-color: $subdued-text-md-color !default;
-
-
-// Switch
-// -----------------------------------------
-
-ion-switch {
- display: block;
- @include user-select-none();
-}
-
-
-// Switch Wrapper
-// -----------------------------------------
-
-.switch-media {
- margin: $switch-md-media-margin;
- padding: $switch-md-media-padding;
- cursor: pointer;
-}
-
-
-// Switch Background Track
-// -----------------------------------------
-
-.switch-icon {
- // bg track, when not checked
- position: relative;
- display: block;
- width: $switch-md-track-width;
- height: $switch-md-track-height;
- pointer-events: none;
- border-radius: $switch-md-track-height;
-
- background-color: $switch-md-track-background-color-off;
- transition: background-color $switch-md-transition-duration
-}
-
-
-// Switch Knob
-// -----------------------------------------
-
-.switch-icon:after {
- // knob, when not checked
- content: '';
- position: absolute;
- top: ($switch-md-handle-height - $switch-md-track-height) / -2;
- left: 0;
-
- width: $switch-md-handle-width;
- height: $switch-md-handle-height;
-
- border-radius: $switch-md-handle-border-radius;
- box-shadow: $switch-md-handle-box-shadow;
-
- background-color: $switch-md-handle-background-color-off;
-
- transition-property: transform, background-color;
- transition-duration: $switch-md-transition-duration;
-}
-
-
-// Switch Checked
-// -----------------------------------------
-
-ion-switch[aria-checked=true] .switch-icon {
- // bg track, when not checked
- background-color: $switch-md-track-background-color-on;
-
- &:after {
- // knob, when not checked
- background-color: $switch-md-handle-background-color-on;
- transform: translate3d($switch-md-track-width - $switch-md-handle-width, 0, 0);
- }
-}
-
-
-// Switch Disabled
-// -----------------------------------------
-
-ion-switch[aria-disabled=true] {
- opacity: $switch-md-disabled-opacity;
- color: $switch-md-disabled-text-color;
- pointer-events: none;
-}
-
-
-// Material Design Color Mixin
-// --------------------------------------------------
-
-@mixin switch-theme-md($color-name, $bg-on) {
-
- ion-switch[#{$color-name}] {
-
- &[aria-checked=true] .switch-icon {
- background-color: lighten($bg-on, 25%);
- }
-
- &[aria-checked=true] .switch-icon:after {
- background-color: $bg-on;
- }
-
- }
-
-}
-
-
-// Generate Material Design Switch Auxiliary Colors
-// --------------------------------------------------
-
-@each $color-name, $value in $colors-md {
-
- @include switch-theme-md($color-name, $value);
-
-}
diff --git a/ionic/components/tabs/tab.ts b/ionic/components/tabs/tab.ts
index 131f6e7005..aa56dbbd91 100644
--- a/ionic/components/tabs/tab.ts
+++ b/ionic/components/tabs/tab.ts
@@ -1,4 +1,4 @@
-import {ChangeDetectorRef, Component, Directive, Host, ElementRef, Compiler, AppViewManager, NgZone, Renderer} from 'angular2/angular2';
+import {ChangeDetectorRef, Component, Directive, Host, ElementRef, Compiler, AppViewManager, NgZone, Renderer} from 'angular2/core';
import {IonicApp} from '../app/app';
import {Config} from '../../config/config';
@@ -13,8 +13,8 @@ import {Tabs} from './tabs';
* @usage
* ```html
*
- *
- *
+ *
+ *
*
* ```
*
@@ -34,8 +34,8 @@ import {Tabs} from './tabs';
*
* @property {any} [root] - set the root page for this tab
- * @property {any} [tab-title] - set the title of this tab
- * @property {any} [tab-icon] - set the icon for this tab
+ * @property {any} [tabTitle] - set the title of this tab
+ * @property {any} [tabIcon] - set the icon for this tab
*/
@Component({
diff --git a/ionic/components/tabs/tabs.ios.scss b/ionic/components/tabs/tabs.ios.scss
index 968f8db08c..a33c7c636b 100644
--- a/ionic/components/tabs/tabs.ios.scss
+++ b/ionic/components/tabs/tabs.ios.scss
@@ -21,7 +21,7 @@ tabbar {
background: $tabbar-ios-background;
}
-ion-tabs[tabbar-placement=top] tabbar {
+ion-tabs[tabbarPlacement=top] tabbar {
border-top: none;
border-bottom: 1px solid $toolbar-ios-border-color;
}
@@ -60,8 +60,8 @@ ion-tabs[tabbar-placement=top] tabbar {
}
}
-[tabbar-icons=right] .tab-button,
-[tabbar-icons=left] .tab-button {
+[tabbarIcons=right] .tab-button,
+[tabbarIcons=left] .tab-button {
.tab-button-text {
font-size: 1.4rem;
@@ -77,7 +77,7 @@ ion-tabs[tabbar-placement=top] tabbar {
}
}
-[tabbar-icons=hide] .tab-button-text {
+[tabbarIcons=hide] .tab-button-text {
font-size: 1.4rem;
line-height: 1.1;
}
@@ -101,7 +101,7 @@ ion-tabs[tabbar-placement=top] tabbar {
border-top-width: 0.55px;
}
- &[tabbar-placement="top"] tabbar {
+ &[tabbarPlacement="top"] tabbar {
border-bottom-width: 0.55px;
}
diff --git a/ionic/components/tabs/tabs.md.scss b/ionic/components/tabs/tabs.md.scss
index 3273111a2e..5fe0766c7d 100644
--- a/ionic/components/tabs/tabs.md.scss
+++ b/ionic/components/tabs/tabs.md.scss
@@ -49,13 +49,13 @@ tabbar {
min-width: $tabbar-md-item-icon-size + 5;
}
-[tabbar-icons=bottom] .tab-button {
+[tabbarIcons=bottom] .tab-button {
padding-top: 8px;
padding-bottom: 8px;
}
-[tabbar-icons=right] .tab-button,
-[tabbar-icons=left] .tab-button {
+[tabbarIcons=right] .tab-button,
+[tabbarIcons=left] .tab-button {
padding-bottom: 10px;
icon {
@@ -84,7 +84,7 @@ tab-highlight {
}
}
-[tabbar-placement=bottom] tab-highlight {
+[tabbarPlacement=bottom] tab-highlight {
top: 0;
}
diff --git a/ionic/components/tabs/tabs.scss b/ionic/components/tabs/tabs.scss
index 4da71363b6..2da72784a4 100644
--- a/ionic/components/tabs/tabs.scss
+++ b/ionic/components/tabs/tabs.scss
@@ -43,7 +43,7 @@ ion-tabbar-section {
order: $flex-order-tabbar-bottom;
}
-[tabbar-placement=top] ion-tabbar-section {
+[tabbarPlacement=top] ion-tabbar-section {
order: $flex-order-tabbar-top;
}
@@ -108,13 +108,13 @@ tab-highlight {
display: none;
}
-[tabbar-icons=bottom] .tab-button {
+[tabbarIcons=bottom] .tab-button {
.tab-button-icon {
order: 10;
}
}
-[tabbar-icons=left] .tab-button {
+[tabbarIcons=left] .tab-button {
flex-direction: row;
.tab-button-icon {
@@ -123,7 +123,7 @@ tab-highlight {
}
}
-[tabbar-icons=right] .tab-button {
+[tabbarIcons=right] .tab-button {
flex-direction: row;
.tab-button-icon {
@@ -133,6 +133,6 @@ tab-highlight {
}
}
-[tabbar-icons=hide] .tab-button-icon {
+[tabbarIcons=hide] .tab-button-icon {
display: none;
}
diff --git a/ionic/components/tabs/tabs.ts b/ionic/components/tabs/tabs.ts
index fa160401ff..c30838214f 100644
--- a/ionic/components/tabs/tabs.ts
+++ b/ionic/components/tabs/tabs.ts
@@ -1,4 +1,5 @@
-import {Directive, ElementRef, Optional, Host, NgFor, NgIf, forwardRef, ViewContainerRef} from 'angular2/angular2';
+import {Directive, ElementRef, Optional, Host, forwardRef, ViewContainerRef} from 'angular2/core';
+import {NgFor, NgIf} from 'angular2/common';
import {Ion} from '../ion';
import {Attr} from '../app/id';
@@ -13,10 +14,10 @@ import {rafFrames} from '../../util/dom';
/**
* @name Tabs
- * @property {any} [tabbar-placement] - set position of the tabbar, top or bottom
- * @property {any} [tabbar-icons] - set the position of the tabbar's icons: top, bottom, left, right, hide
+ * @property {any} [tabbarPlacement] - set position of the tabbar, top or bottom
+ * @property {any} [tabbarIcons] - set the position of the tabbar's icons: top, bottom, left, right, hide
* @property {any} [tabbar-style] - sets tabbar's style (primary, secondary, etc)
- * @property {any} [preload-tabs] - sets whether to preload all the tabs, true or false
+ * @property {any} [preloadTabs] - sets whether to preload all the tabs, true or false
* @usage
* ```html
*
@@ -47,8 +48,8 @@ import {rafFrames} from '../../util/dom';
'' +
'' +
'' +
- '' +
- '' +
+ '' +
+ '' +
'{{t.tabTitle}}' +
'' +
'' +
diff --git a/ionic/components/tabs/test/advanced/tabs.html b/ionic/components/tabs/test/advanced/tabs.html
index 9a686c91c9..60675d722b 100644
--- a/ionic/components/tabs/test/advanced/tabs.html
+++ b/ionic/components/tabs/test/advanced/tabs.html
@@ -1,6 +1,6 @@
-
-
-
-
+
+
+
+
diff --git a/ionic/components/tabs/test/basic/index.ts b/ionic/components/tabs/test/basic/index.ts
index 6648d682c1..bf296a3ac4 100644
--- a/ionic/components/tabs/test/basic/index.ts
+++ b/ionic/components/tabs/test/basic/index.ts
@@ -13,7 +13,7 @@
Tab 1
- Item {{i}} {{i}} {{i}} {{i}}
+ Item {{i}} {{i}} {{i}} {{i}}
`
@@ -39,7 +39,7 @@ class Tab1 {
-
+
{{session.name}} {{session.name}} {{session.name}}
{{session.location}} {{session.location}} {{session.location}}
@@ -71,7 +71,7 @@ class Tab2 {
@Page({
template: `
-
+
Stopwatch
@@ -92,7 +92,7 @@ class Tab3 {}
-
+
Close Menu
@@ -100,9 +100,9 @@ class Tab3 {}
-
-
-
+
+
+
`
})
diff --git a/ionic/components/tabs/test/ghost/index.ts b/ionic/components/tabs/test/ghost/index.ts
index cb31731976..d71b3cf5db 100644
--- a/ionic/components/tabs/test/ghost/index.ts
+++ b/ionic/components/tabs/test/ghost/index.ts
@@ -1,6 +1,6 @@
import {App, Page, NavController, Tab} from 'ionic/ionic';
-import {ContentChild, QueryList, ViewChildren} from 'angular2/angular2';
+import {ContentChild, QueryList, ViewChildren} from 'angular2/core';
//
// Tab 1
@@ -46,7 +46,7 @@ class Tab2 {
@Page({
template: `
-
+
Stopwatch
@@ -68,7 +68,7 @@ class Tab3 {
@Page({
template: `
-
+
Quesarito
@@ -92,7 +92,7 @@ class QuesaritoPage {
-
+
Quesarito
@@ -100,9 +100,9 @@ class QuesaritoPage {
-
-
-
+
+
+
`
})
diff --git a/ionic/components/tabs/test/tab-bar-scenarios/main.html b/ionic/components/tabs/test/tab-bar-scenarios/main.html
index 222687e048..3414bd47a7 100644
--- a/ionic/components/tabs/test/tab-bar-scenarios/main.html
+++ b/ionic/components/tabs/test/tab-bar-scenarios/main.html
@@ -1,69 +1,69 @@
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/ionic/components/tap-click/tap-click.ts b/ionic/components/tap-click/tap-click.ts
index 6b85bc268e..03155645fd 100644
--- a/ionic/components/tap-click/tap-click.ts
+++ b/ionic/components/tap-click/tap-click.ts
@@ -1,4 +1,4 @@
-import {Injectable, NgZone} from 'angular2/angular2';
+import {Injectable, NgZone} from 'angular2/core';
import {IonicApp} from '../app/app';
import {Config} from '../../config/config';
diff --git a/ionic/components/text-input/label.ts b/ionic/components/text-input/label.ts
index 3adea59ca1..24ef7c886c 100644
--- a/ionic/components/text-input/label.ts
+++ b/ionic/components/text-input/label.ts
@@ -1,8 +1,11 @@
-import {Directive, Optional, ElementRef, Renderer} from 'angular2/angular2';
+import {Directive, Optional, ElementRef, Renderer} from 'angular2/core';
import {Config} from '../../config/config';
import {TextInput} from './text-input';
import {pointerCoord, hasPointerMoved} from '../../util/dom';
+import {Form} from '../../util/form';
+
+
/**
* @name Label
* @description
@@ -39,15 +42,19 @@ export class Label {
constructor(
config: Config,
@Optional() container: TextInput,
+ private form: Form,
private elementRef: ElementRef,
private renderer: Renderer
) {
this.scrollAssist = config.get('scrollAssist');
- if (!this.id) {
- this.id = 'lbl-' + (++labelIds);
- }
this.container = container;
- container && container.registerLabel(this);
+ }
+
+ ngOnInit() {
+ if (!this.id) {
+ this.id = 'lbl-' + this.form.nextId();
+ }
+ this.container && this.container.registerLabel(this);
}
/**
@@ -88,5 +95,3 @@ export class Label {
}
}
-
-let labelIds = -1;
diff --git a/ionic/components/text-input/test/floating-labels/index.ts b/ionic/components/text-input/test/floating-labels/index.ts
index 43aed36502..79de5a9b12 100644
--- a/ionic/components/text-input/test/floating-labels/index.ts
+++ b/ionic/components/text-input/test/floating-labels/index.ts
@@ -4,4 +4,12 @@ import {App} from 'ionic/ionic';
@App({
templateUrl: 'main.html'
})
-class E2EApp {}
+class E2EApp {
+ constructor() {
+ this.myValues = {
+ value1: 'Dynamic Input',
+ value2: 'Dynamic Textarea'
+ };
+ }
+
+}
diff --git a/ionic/components/text-input/test/floating-labels/main.html b/ionic/components/text-input/test/floating-labels/main.html
index ca011371cc..93fe74fe49 100644
--- a/ionic/components/text-input/test/floating-labels/main.html
+++ b/ionic/components/text-input/test/floating-labels/main.html
@@ -8,10 +8,11 @@
Floating Label 1
-
+
+ Value: {{ myValues.value1 }}
-
+
Floating Label 2
@@ -23,8 +24,9 @@
Floating Label 4
-
+
+ Value: {{ myValues.value2 }}
Floating Label 5
diff --git a/ionic/components/text-input/test/form-inputs/index.ts b/ionic/components/text-input/test/form-inputs/index.ts
index 1eb3f9b37f..9d55a29d72 100644
--- a/ionic/components/text-input/test/form-inputs/index.ts
+++ b/ionic/components/text-input/test/form-inputs/index.ts
@@ -1,5 +1,5 @@
import {App} from 'ionic/ionic';
-import {FormBuilder, Validators} from 'angular2/angular2';
+import {FormBuilder, Validators} from 'angular2/common';
@App({
diff --git a/ionic/components/text-input/test/form-inputs/main.html b/ionic/components/text-input/test/form-inputs/main.html
index 545ed7758b..73cf6f005b 100644
--- a/ionic/components/text-input/test/form-inputs/main.html
+++ b/ionic/components/text-input/test/form-inputs/main.html
@@ -4,12 +4,12 @@
-
+
-
+
+ Radio 2
+
diff --git a/ionic/components/text-input/text-input.scss b/ionic/components/text-input/text-input.scss
index 618f19c1dd..4ddcc82d3e 100644
--- a/ionic/components/text-input/text-input.scss
+++ b/ionic/components/text-input/text-input.scss
@@ -17,6 +17,10 @@ $text-input-textarea-resize: none !default;
pointer-events: none;
}
+input.item-input:-webkit-autofill {
+ background-color: transparent;
+}
+
// Scroll Assist
// --------------------------------------------------
diff --git a/ionic/components/text-input/text-input.ts b/ionic/components/text-input/text-input.ts
index a4ae10c534..66507c478d 100644
--- a/ionic/components/text-input/text-input.ts
+++ b/ionic/components/text-input/text-input.ts
@@ -1,4 +1,5 @@
-import {Component, Directive, Attribute, NgIf, forwardRef, Host, Optional, ElementRef, Renderer, Attribute} from 'angular2/angular2';
+import {Component, Directive, Attribute, forwardRef, Host, Optional, ElementRef, Renderer} from 'angular2/core';
+import {NgIf, NgControl} from 'angular2/common';
import {NavController} from '../nav/nav-controller';
import {Config} from '../../config/config';
@@ -59,7 +60,7 @@ import {Platform} from '../../platform/platform';
template:
'' +
'' +
- '' +
+ '' +
'
',
directives: [NgIf, forwardRef(() => InputScrollAssist)]
})
@@ -105,7 +106,7 @@ export class TextInput {
* This function is used to add the Angular css classes associated with inputs in forms
*/
addNgClass(className) {
- return this.input.elementRef.nativeElement.classList.contains(className);
+ this.input && this.input.elementRef.nativeElement.classList.contains(className);
}
/**
@@ -132,7 +133,7 @@ export class TextInput {
/**
* @private
*/
- ngOnInit() {
+ ngAfterViewInit() {
if (this.input && this.label) {
// if there is an input and an label
// then give the label an ID
@@ -455,7 +456,7 @@ export class TextInput {
* @private
*/
@Directive({
- selector: 'textarea,input[type=text],input[type=password],input[type=number],input[type=search],input[type=email],input[type=url],input[type=tel]',
+ selector: 'textarea,input[type=text],input[type=password],input[type=number],input[type=search],input[type=email],input[type=url],input[type=tel],input[type=date],input[type=datetime],input[type=datetime-local],input[type=week],input[type=time]',
inputs: ['value'],
host: {
'(focus)': 'focusChange(true)',
@@ -469,7 +470,8 @@ export class TextInputElement {
@Attribute('type') type: string,
elementRef: ElementRef,
renderer: Renderer,
- @Optional() wrapper: TextInput
+ @Optional() wrapper: TextInput,
+ @Optional() ngControl: NgControl
) {
this.type = type;
this.elementRef = elementRef;
@@ -484,9 +486,12 @@ export class TextInputElement {
renderer.setElementClass(elementRef, 'item-input', true);
wrapper.registerInput(this);
}
+
+ if (ngControl) this.ngControl = ngControl;
}
ngOnInit() {
+ if (this.ngControl) this.value = this.ngControl.value;
this.wrapper && this.wrapper.hasValue(this.value);
}
diff --git a/ionic/components/switch/test/basic/e2e.ts b/ionic/components/toggle/test/basic/e2e.ts
similarity index 80%
rename from ionic/components/switch/test/basic/e2e.ts
rename to ionic/components/toggle/test/basic/e2e.ts
index 6c4ea1b431..efb5b33089 100644
--- a/ionic/components/switch/test/basic/e2e.ts
+++ b/ionic/components/toggle/test/basic/e2e.ts
@@ -1,6 +1,6 @@
it('should check apple via switch element click', function() {
- element(by.css('[ng-control=appleCtrl] .switch-media')).click();
+ element(by.css('[ngControl=appleCtrl] .toggle-media')).click();
});
diff --git a/ionic/components/switch/test/basic/index.ts b/ionic/components/toggle/test/basic/index.ts
similarity index 96%
rename from ionic/components/switch/test/basic/index.ts
rename to ionic/components/toggle/test/basic/index.ts
index dde96c875f..1d8c6a59c3 100644
--- a/ionic/components/switch/test/basic/index.ts
+++ b/ionic/components/toggle/test/basic/index.ts
@@ -9,7 +9,7 @@ import {
NgControlName,
NgFormModel,
FormBuilder
-} from 'angular2/angular2';
+} from 'angular2/common';
@App({
templateUrl: 'main.html'
diff --git a/ionic/components/switch/test/basic/main.html b/ionic/components/toggle/test/basic/main.html
similarity index 68%
rename from ionic/components/switch/test/basic/main.html
rename to ionic/components/toggle/test/basic/main.html
index c640bfeb06..569215b24e 100644
--- a/ionic/components/switch/test/basic/main.html
+++ b/ionic/components/toggle/test/basic/main.html
@@ -1,36 +1,36 @@
-Switches
+Toggles
-