diff --git a/ionic/components/scroll/scroll.js b/ionic/components/scroll/scroll.ts similarity index 100% rename from ionic/components/scroll/scroll.js rename to ionic/components/scroll/scroll.ts diff --git a/ionic/components/scroll/test/basic/index.js b/ionic/components/scroll/test/basic/index.js deleted file mode 100644 index 265d76f100..0000000000 --- a/ionic/components/scroll/test/basic/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; - -import {IonicView} from 'ionic/ionic'; - - -@Component({ selector: 'ion-app' }) -@IonicView({ - templateUrl: 'main.html' -}) -class IonicApp { - constructor() { - console.log('IonicApp Start') - } - doRefresh() { - console.log('DOREFRESH') - } -} - -export function main(ionicBootstrap) { - ionicBootstrap(IonicApp); -} diff --git a/ionic/components/scroll/test/basic/index.ts b/ionic/components/scroll/test/basic/index.ts index a7619dbcca..ce94a63160 100644 --- a/ionic/components/scroll/test/basic/index.ts +++ b/ionic/components/scroll/test/basic/index.ts @@ -7,7 +7,7 @@ import {IonicView} from 'ionic/ionic'; @IonicView({ templateUrl: 'main.html' }) -class IonicApp { +class MyApp { constructor() { console.log('IonicApp Start') } @@ -17,5 +17,5 @@ class IonicApp { } export function main(ionicBootstrap) { - ionicBootstrap(IonicApp); + ionicBootstrap(MyApp); } diff --git a/ionic/components/segment/segment.ts b/ionic/components/segment/segment.ts index 772e8bbf16..84681dd9a3 100644 --- a/ionic/components/segment/segment.ts +++ b/ionic/components/segment/segment.ts @@ -193,46 +193,3 @@ export class SegmentButton { } } - - -@IonicDirective({ - selector: 'ion-segment', - host: { - '(change)': 'onChange($event.target.value)', - '(input)': 'onChange($event.target.value)', - '(blur)': 'onTouched()', - '[value]': 'value', - '[class.ng-untouched]': 'cd.control?.untouched == true', - '[class.ng-touched]': 'cd.control?.touched == true', - '[class.ng-pristine]': 'cd.control?.pristine == true', - '[class.ng-dirty]': 'cd.control?.dirty == true', - '[class.ng-valid]': 'cd.control?.valid == true', - '[class.ng-invalid]': 'cd.control?.valid == false' - } -}) -export class SegmentControlValueAccessor { - constructor(cd: NgControl, renderer: Renderer, elementRef: ElementRef, segment: Segment) { - this.onChange = (_) => {}; - this.onTouched = (_) => {}; - this.cd = cd; - this.renderer = renderer; - this.elementRef = elementRef; - this.segment = segment; - - cd.valueAccessor = this; - } - - writeValue(value) { - // both this.value and setProperty are required at the moment - // remove when a proper imperative API is provided - this.value = !value ? '' : value; - this.renderer.setElementProperty(this.elementRef.parentView.render, this.elementRef.boundElementIndex, 'value', this.value); - - this.segment.value = this.value; - this.segment.selectFromValue(value); - } - - registerOnChange(fn) { this.onChange = fn; } - - registerOnTouched(fn) { this.onTouched = fn; } -}