Ionic4 - Segment


#1

I am trying out ionic4 beta, recently i just found ion-segment (ionChanged) event is not passing ion-segment-button value
Anyone has already got this error and could able to resolve it ?

<ion-segment [(ngModel)]=‘currentTab’ (ionChange)=“segmentChanged($event)”>

private segmentChanged(segment: any) {
console.log('Tab changed: ’ + JSON.stringify(segment))
}

output:
Tab changed: {“isTrusted”:false}


#2

not sure that’s your error but the first thing I see is that your method segmentChanged should be public not private as it is use from your template


#3

i made it as public and it is the same. As i mentioned the event is triggering but the $event what i am receiving on the function is {“isTrusted”:false}.
i appreciate your help.


#4

second thing you could try, remove the JSON.stringify in your console.log

 console.log('Tab changed’, segment);

better?