I have the following ion-segment HTML code:
<ion-segment (ionChange)="segmentChanged($event)" scrollable>
<ion-segment-button checked value="calendar">
<ion-icon name="calendar"></ion-icon>
</ion-segment-button>
<ion-segment-button value="list-box">
<ion-icon name="list-box"></ion-icon>
</ion-segment-button>
</ion-segment>
<ion-card [hidden]="true">
test
</ion-card>
<ion-card>
test
</ion-card>
I want to swap which card becomes visible when I press the segment button. Now I could easily fix this using Jquery, but I want to do this without JQuery.
I have the following event, which is being triggered correctly atm:
segmentChanged(): void {
console.log("I triggered")
}
What is the best (or a good) way to implement this functionality?