saidmrn
December 25, 2017, 8:04pm
1
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
robinyo
December 25, 2017, 11:30pm
2
-> is it possible to add an ion-tabs just for a page?
Try:
<ion-tabs [selectedIndex]="tabIndex" name="event">
<ion-tab [root]="tab1Root" tabTitle="Restaurants" tabIcon="restaurants"></ion-tab>
</ion-tabs>
saidmrn
December 26, 2017, 1:26am
3
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-tabs>
<ion-tab [root]="tab1Root"></ion-tab>
<ion-tab [root]="tab2Root"></ion-tab>
<ion-tab [root]="tab3Root"></ion-tab>
</ion-tabs>
and
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.
saidmrn
December 26, 2017, 1:20pm
5
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.
saidmrn
December 26, 2017, 1:49pm
7
but using like this,i canāt use this plugin alright ?
I think you have to try it. But why not?
saidmrn
December 26, 2017, 3:02pm
9
i donāt think so,because the supertabs use this stucture:
<ion-tabs>
<ion-tab [root]="tab1Root"></ion-tab>
<ion-tab [root]="tab2Root"></ion-tab>
<ion-tab [root]="tab3Root"></ion-tab>
</ion-tabs>
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.
saidmrn
December 26, 2017, 10:16pm
11
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 :
tabsHideOnSubPages="true"