angular - Tabs disappears ionic 3 after push -
my tabs disappears after using this.navctrl.push(namepage);
i don't understand, need use @viewchild
or function? have set tabshideonsubpages
on false
in app.module.ts
example : https://github.com/nicolas-pl/testmenu
files : src/pages/tabs/tabs.ts
, src/pages/test/test.ts
import { component } '@angular/core'; import { navcontroller } 'ionic-angular'; import { aboutpage } '../about/about'; import { contactpage } '../contact/contact'; import { homepage } '../home/home'; import { testpage } '../test/test'; import { modalcontroller } 'ionic-angular'; @component({ templateurl: 'tabs.html' }) export class tabspage { tab1root = homepage; tab2root = aboutpage; tab3root = testpage; constructor(public navctrl: navcontroller,public modalctrl: modalcontroller) { } openmodal() { let mymodal = this.modalctrl.create(testpage); mymodal.present(); } }
<ion-tabs> <ion-tab [root]="tab1root" tabtitle="home" tabicon="home"></ion-tab> <ion-tab [root]="tab2root" tabtitle="about" tabicon="information-circle"></ion-tab> <ion-tab (ionselect)="openmodal()" tabtitle="contact" tabicon="contacts"></ion-tab> </ion-tabs>
test.ts (tabs disappears)
import { component } '@angular/core'; import { ionicpage, navcontroller, navparams } 'ionic-angular'; import { homepage } '../home/home'; import { app, viewcontroller } 'ionic-angular'; @ionicpage() @component({ selector: 'page-test', templateurl: 'test.html', }) export class testpage { constructor(public viewctrl: viewcontroller, public navctrl: navcontroller, public navparams: navparams) {} ionviewdidload() {} openmenu() { this.navctrl.push(homepage); } }
i have try this.navctrl.root(homepage);
don't works..
thank in advance !
if need navigate overlay
component (popover
, modal
, alert
, etc) must below.
test.ts
export class testpage { constructor( public viewctrl: viewcontroller public appctrl: app ) {} openmenu() { this.viewctrl.dismiss(); this.appctrl.getrootnav().setroot(homepage); } }
you can read more it here(see under title navigating overlay component
).
Comments
Post a Comment