refactor(segment): changed segment event emitter type to SegmentButton and update the change to emit value

Fixed tests to reflect this. References #819
This commit is contained in:
Brandy Carney
2015-12-29 13:55:53 -05:00
parent 64b76099cd
commit b1bdc31a76
3 changed files with 9 additions and 9 deletions

View File

@ -55,7 +55,7 @@ import {isDefined} from '../../util/util';
})
export class SegmentButton {
@Input() value: string;
@Output() select: EventEmitter<any> = new EventEmitter();
@Output() select: EventEmitter<SegmentButton> = new EventEmitter();
constructor(private _renderer: Renderer, private _elementRef: ElementRef) {}
@ -131,8 +131,8 @@ export class SegmentButton {
selector: 'ion-segment'
})
export class Segment {
@Output() change: EventEmitter<any> = new EventEmitter();
@ContentChildren(SegmentButton) _buttons;
@Output() change: EventEmitter<SegmentButton> = new EventEmitter();
value: any;
constructor(
@ -169,7 +169,7 @@ export class Segment {
button.select.subscribe((selectedButton) => {
this.writeValue(selectedButton.value);
this.onChange(selectedButton.value);
this.change.emit(selectedButton.value);
this.change.emit(selectedButton);
});
if (isDefined(this.value)) {