Detect change on ion-segment


#1

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>


#2

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


#3

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


#4

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

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