This commit is contained in:
Max Lynch
2015-06-25 13:04:57 -05:00
parent e42daa3f78
commit 027defea79
3 changed files with 19 additions and 30 deletions

View File

@ -65,7 +65,7 @@ export class Segment {
static get config() {
return {
selector: 'ion-segment',
appInjector: [ NgFormControl ],
appInjector: [ NgControl ],
properties: [
'value'
],
@ -85,7 +85,7 @@ export class Segment {
}
constructor(
cd: NgFormControl,
cd: NgControl,
elementRef: ElementRef,
renderer: Renderer
) {
@ -135,9 +135,9 @@ export class Segment {
*/
selected(segmentButton) {
for(let button of this.buttons) {
button.setActive(false);
button.isActive = false;
}
segmentButton.setActive(true);
segmentButton.isActive = true;
//this.onChange();
@ -147,7 +147,7 @@ export class Segment {
this.cd.valueAccessor.writeValue(segmentButton.value);
this.selectFromValue(segmentButton.value);
this.cd.form.updateValue(segmentButton.value);
this.cd.control.updateValue(segmentButton.value);
// Trigger on change
this.change.next();
@ -185,10 +185,6 @@ export class SegmentButton {
this.segment.register(this);
}
setActive(isActive) {
this.isActive = isActive;
}
buttonClicked(event) {
this.segment.selected(this, event);
event.preventDefault();