Tabs on HomePage


#1

Hi, im trying to make tabs in my HomePage, but the page isnt loading when i put the HomePage as the selected index in tabs, here’s my Code:
home.ts:

...
export class HomePage {
  public isConnected: Boolean= true;
 
  homeRoot = HomePage;
  aRoot = SigninPage;
  bRoot = SignupPage;
...

home.html:

///SOME CONTENT
<ion-tabs selectedIndex="0" *ngIf="isConnected">
                <ion-tab [root]="homeRoot" tabTitle="Home"></ion-tab>
                <ion-tab [root]="aRoot" tabTitle="Home"></ion-tab>
                <ion-tab [root]="bRoot" tabTitle="Home"></ion-tab>
            
            </ion-tabs>

#2

Hi,

Could you share your app.component.ts?


#3

Yea sure

import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { HomePage } from '../pages/home/home';
import { SignupPage } from '../pages/signup/signup';
import {ValidationPage} from '../pages/validation/validation'
import {GmapPage} from '../pages/gmap/gmap';


@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage:any = HomePage;

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();
    });
  }
}