Detect change on ion-segment

When using ion-segment, certain elements are not appearing ( images loaded locally in this case ).
I would like to detect that a segment has been changed to and then call a function.
I have tried:
(change)="onSegmentChange(cur_segment)"
and
(click)="images_segment_click"

Both in the<ion-segment>
and the <ion-segment-button>

1 Like

Have you tried (ionChange)="onSegmentChange()" ?

3 Likes

Ahhh, yes, I did but only on the button.
<ion-segment (ionChange)="onSegmentChange()"> works!
Thank you!

4 Likes

i can implement it like you but in <ion-segment-buttons …>

<ion-segment [(ngModel)]=“configureTile” name=“configureTile” [ngModelOptions]="{standalone: true}" (ionChange)=“changeTileType()”>

doesn’t work. no error nothing. just not working.