mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
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:
@ -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)) {
|
||||
|
Reference in New Issue
Block a user