Tabs should display only after LoggedIn


#1

Hi,

I have some following queries in Ionic3-

1- Public Pages(Without login), Ionic Tabs should not be display
2- After Login, redirected to Home Page
and on this page navigation/side menu should present with only Tabs on bottom(without selected)

For example-

After Login, user redirected to Home page and Tabs should be visible there without selected-

In side menu following pages present

  • Home
  • About
  • Account details
  • History
  • Receipt

In bottom tabs only following pages present from above but it should display on all pages of side menu

  • Account details
  • History
  • Receipt

Anyone help please.

Thanks,


#2

I know lots of people seem to like it, because there are a zillion questions here asking about the combo, but personally I find both sidemenus and tabs to be a really confusing UI, and just use one or the other.


#3

Okay, Then I have only required Ionic Tabs but this should be display only after login of all pages.

How can be fix above in Ionic2/3?

Also I have one more problem to dry code in Ionic3 Lazy loading to open page on click button as -


homePage() {
    this.navCtrl.push('HomePage');
}

If I have to open multiple pages then above type code need to written multiple times but I want to create a global code like-

functionName(pageName) {
    this.navCtrl.push('PageName');
}

and only add in html as following without writing again in typescript file-

<button ion-button (click)='functionName(pageName)'>Button</button>

How to do above…Kindly advise.

Thanks,


#4

I don’t think that makes much sense, because there can be multiple NavControllers.