I have a page with 2 tabs. When I go to the page, it starts off as blank with just the 2 tab buttons showing. Once I click on either of the buttons, the contents of the tabs display. How can I make it so when I navigate to that page, one of the tabs is already open by default? Here is the html I have:
<ion-segment [(ngModel)]="list">
<ion-segment-button value="list">list view</ion-segment-button>
<ion-segment-button value="cal">calendar view</ion-segment-button>
</ion-segment>
<div [ngSwitch]="list">
<div *ngSwitchCase="'list'">
**list tab contents**
</div>
<div *ngSwitchCase="'cal'">
**calendar tab contents**
</div>
</div>
</div>
You should set that in the default path of the tabs page routing module. Here you have a full example:
tabs-routing.module.ts
tabs.module.ts
tabs.page.ts
tabs.page.html
tab-one.module.ts
tab-one.page.ts