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

@@ -20,12 +20,12 @@ class MyApp {
this.appType = 'free';
}
onSegmentChanged(value) {
console.log("Segment changed to", value);
onSegmentChanged(segmentButton) {
console.log("Segment changed to", segmentButton.value);
}
onSegmentClicked(value) {
console.log("Segment clicked", value);
onSegmentSelected(segmentButton) {
console.log("Segment selected", segmentButton.value);
}
doSubmit(event) {

View File

@@ -1,9 +1,9 @@
<ion-toolbar>
<ion-segment id="segment" [(ngModel)]="relationship" (change)="onSegmentChanged($event)">
<ion-segment-button value="friends" (click)="onSegmentClicked('friends')" class="e2eSegmentFriends">
<ion-segment-button value="friends" (select)="onSegmentSelected($event)" class="e2eSegmentFriends">
Friends
</ion-segment-button>
<ion-segment-button value="enemies" (click)="onSegmentClicked('enemies')">
<ion-segment-button value="enemies" (select)="onSegmentSelected($event)">
Enemies
</ion-segment-button>
</ion-segment>