Ion-tabs just for one page?

is it possible to add an ion-tabs just for a page ?

I have PAGE: Restaurants and PAGE Favorites

how can i add a tabs to switch between Restaurants and Favorites without this tab appears on other pages ?

I searched and only found how to hide it.But i want to add to particular page because i will have another tabs for another pages.

Thanks !

1 Like

-> is it possible to add an ion-tabs just for a page?


<ion-tabs [selectedIndex]="tabIndex" name="event">

  <ion-tab [root]="tab1Root" tabTitle="Restaurants" tabIcon="restaurants"></ion-tab>


Hi,thanks for the help again.
for unknown reason,when i add it to my page,when i click to load it,the browser stop responding and i need to force to close it.

i added :

  <ion-tab [root]="tab1Root"></ion-tab>
  <ion-tab [root]="tab2Root"></ion-tab>
  <ion-tab [root]="tab3Root"></ion-tab>


 tab1Root = Page1;
  tab2Root = Page2;
  tab3Root = Page3;

I don’t know ig i get your question right.

I have an app with tabs as root page. When I use navCtrl.push(‘newPage’) then it shows the new Page without tabs.

Or I use this to push another tab page with different tabs.

And I use nabCtr.setRoot(‘loginPage’). Works too.

Hello Jacktoolsnet ! thanks ! i’ll try it but if i use it,when the user changes the page via push,the tab will not change indicating which page he is alright ?

No. The pushed page lays over the tab page until you use navCtrl.pop() to remove it.

but using like this,i can’t use this plugin alright ?

I think you have to try it. But why not?

i don’t think so,because the supertabs use this stucture:

  <ion-tab [root]="tab1Root"></ion-tab>
  <ion-tab [root]="tab2Root"></ion-tab>
  <ion-tab [root]="tab3Root"></ion-tab>

if i push one page,i’ll not be using that stucture above,do you agree ?

This looks like in the ionic docs.

Here is a screencast where you can see how setroot an push works.

Wow awesome app!

i just solved my problem.
I was generating a new page,but instead of use ionic g page,i used ionic g.
ionic show me list and i found “tabs” in the list,so i create the tabs via cmd,tested and is working well !

i added too :