@shmu80 wrote:
I am using ion-segment in my page, and I want to set one of the segment is selected segment whenever the page show, but it is not working if I use ngSelected="selected".
Anybody can advise how to set the selected segment as default segment whenever the page display?
Code:
<div> <ion-segment [(ngModel)]="testing"> <ion-segment-button value="book">book</ion-segment-button> <ion-segment-button value="table">table</ion-segment-button> </ion-segment> </div><div [ngSwitch]="testing" > <ion-list *ngSwitchWhen="'book'" ngSelected="selected"> <a ion-item> <ion-label>book list</ion-label> </a> </ion-list> <ion-list *ngSwitchWhen="'table'"> <a ion-item> <ion-label>table list</ion-label> </a> </ion-list> </div>
Posts: 1
Participants: 1