Hi,
I’m new to Ionic (version 3.6.0). I have a sidemenu project. If any page is changed using push
from code, this loaded page shows a “back” icon instead of menu icon. But if the same page is loaded from the menu the page keeps its menu icon. My question is how to do the same from code, I want the menu icon when the page is loaded. From a tabbed example I tried using this.navCtrl.parent.select(1)
for my project but gives a null error for select
.
Thank you.
So you want that when the user navigates to a subpage to one of the pages accessible from the sidemenu, to show the menu button instead of the back button that is normally shown? Why?
I have 4 pages from the side menu. Home, Monitor, History, Credits. I want navigate from Home to Monitor and that last page keep its menu icon, so from any page you can jump to any available from the menu. Making home.ts
this.navCtrl.push(MonitorPage)
shows a back icon, not the menu.
Ah ok, so you want to switch the “selected menu” or to another “base page” by clicking on a button on one of the base pages, correct?
Did you create a project with ionic start name sidemenu
? This already includes code to change the “base” page:
1 Like
Yes, my project was created using that command. And for the additonal pages ionic g page name
.
Thank you!!! Solved.
1 Like
how it got solved. this method is in app.component.ts i want to change a page from another page in menu. eg. menu has home and login. now i want to go from login to home. how do i do that?
It finally solved for me. I used <ion-nav [root]=“rootPage” persistent=“true” #content swipeBackEnabled=“false”>
persistent=’“true” made the menu button to show after setting this.nav.setRoot(“OtherBasePage”). Before that it was showing the page but menu icon was not showing.