0
votes

When i open my app, the 1st page which appears is Login.html , after filling the form, it navigates to dashboard.html

Problem: When it goes to Dashboard.html , it shows back arrow on the top left and not the menu icon. I want it to show menu icon here and not the back arrow

This is the code i am using for navigation in login.ts:

if(data[0].USR==1)
       {
         this.navCtrl.push(DashboardPage);

       }

Image of dashboard.html, please notice the arrow on left side

enter image description here

I have to click this arrow > go back to login > then from menu icon, i open menu and select dashboard page, then i see menu icon on dashboard.. why so ?

I have also created a video , sharing its youtube link - http://youtu.be/1eA5KXJkSDE?hd=1

2
were you able to solve this @user2828442?sebaferreras

2 Answers

1
votes

It's default of Ionic when you navigate using push

If you wanna show menu toggle icon, you should use setRoot

Example:

onClickNavigate() {
  console.log("onNavigate");

 this.navCtrl.setRoot("PageTwo")
}

in "PageTwo" html, you need to add toggle button on the header too

<ion-header>
    <ion-navbar>
        <button ion-button menuToggle>
          <ion-icon name="menu"></ion-icon>
        </button>
        <ion-title>page-two</ion-title>
    </ion-navbar>
</ion-header>
0
votes

Seems like you want to set the DashboardPage as a root page, so instead of the push method, use setRoot:

if(data[0].USR == 1) {
  this.navCtrl.setRoot(DashboardPage);
}