IonicComponent_OLD cleanups

This commit is contained in:
Adam Bradley
2015-06-19 09:25:15 -05:00
parent caa6ad4957
commit 384beadf7d
3 changed files with 57 additions and 73 deletions

View File

@ -1,35 +1,40 @@
import {Renderer, ElementRef} from 'angular2/angular2'
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
import {View} from 'angular2/src/core/annotations_impl/view';
import {ControlGroup, ControlDirective} from 'angular2/forms'
import {dom} from 'ionic/util';
import {IonicComponent_OLD} from 'ionic/config/component'
import {IonicComponent} from 'ionic/config/component'
import {Button} from 'ionic/components/button/button'
@Component({
selector: 'ion-segment',
hostListeners: {
'click': 'buttonClicked($event)'
}
})
@IonicComponent(Segment)
@View({
template: `<div class="ion-segment">
<content></content>
</div>
`,
directives: [Button, SegmentButton],
properties: [
'value'
],
hostProperties: {
value: 'value'
}
directives: [Button, SegmentButton]
})
export class Segment {
static get config() {
return {
selector: 'ion-segment',
hostListeners: {
'click': 'buttonClicked($event)'
},
properties: [
'value'
],
hostProperties: {
value: 'value'
}
}
}
constructor(
elementRef: ElementRef,
renderer: Renderer,
@ -47,6 +52,10 @@ export class Segment {
this.buttons = [];
}
onInit() {
Segment.applyConfig(this);
}
/**
* Much like ngModel, this is called from our valueAccessor for the attached
* ControlDirective to update the value internally.
@ -103,8 +112,6 @@ export class Segment {
}
}
new IonicComponent_OLD(Segment, {
});
@Component({
selector: 'ion-segment-button',