Having a hard time understanding the navigation with tabs

You can make fake tabs out of segments like this:

app.html

<ion-header>
  <ion-segment (ionChange)="onSegmentChange($event)">
    <ion-segment-button value="home">home</ion-segment-button>
    <ion-segment-button value="about">about</ion-segment-button>
  </ion-segment>
</ion-header>
<ion-content>
<ion-nav [root]="rootPage"></ion-nav>
</ion-content>

app.component.ts

rootPage: Page;

onSegmentChange(seg: Segment): void {
  let segval = seg.value; 
   if (segval === 'home') {
    this.rootPage = HomePage;
  } else if (segval === 'about') {
    this.rootPage = AboutPage;
  }
}
1 Like