Ionic ion-segment not changed segment-activated


#1

Hello guys!

Guys, I have a problem with my ion-segment. It does not change the class to segment-activeted after the click.

Screen with ion-segment


Html code

Ts Code

But if you use detectChanges from the ChangeDetectorRef it works

<ion-segment [(ngModel)]="relationship" color="primary" (ionChange)="segmentChanged($event)">
    <ion-segment-button value="friends">
      Friends
    </ion-segment-button>
    <ion-segment-button value="enemies">
      Enemies
    </ion-segment-button>
  </ion-segment>

  segmentChanged(segmento){
    this.cf.detectChanges();
  }

But it should be working without needing to use the detectChanges.

Can someone help me?

Thank you!