# Sidemenu navigation icon disappears while navigating to another page?

**URL:** <https://forum.ionicframework.com/t/sidemenu-navigation-icon-disappears-while-navigating-to-another-page/151669>\
**Category:** ionic-v3\
**Created:** [December 30, 2018, 6:13am UTC](https://forum.ionicframework.com/t/sidemenu-navigation-icon-disappears-while-navigating-to-another-page/151669 "2018-12-30T06:13:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sedar](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sedar](https://forum.ionicframework.com/u/sedar)\
**Post date:** [December 30, 2018, 6:13am UTC](https://forum.ionicframework.com/t/sidemenu-navigation-icon-disappears-while-navigating-to-another-page/151669/1 "2018-12-30T06:13:44Z")

</div>

app.component.ts

```auto
import { Component, ViewChild } from '@angular/core';
import { Platform, Nav,App, AlertController,NavController,NavParams } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { LoginPage } from '../pages/login/login'
import { HomePage } from '../pages/home/home';
import { LocationChangePage} from '../pages/location-change/location-change';

@Component({
    templateUrl: 'app.html'
})
export class MyApp {
     @ViewChild(Nav) nav: NavController;
    rootPage: any = LoginPage;

    pages: Array<{ title: string, component: any }>;

    constructor(public platform: Platform,
         statusBar: StatusBar,
         public alertCtrl: AlertController,
         public app: App,
         splashScreen: SplashScreen) {
        platform.ready().then(() => {
        statusBar.styleDefault();
            splashScreen.hide();
            platform.registerBackButtonAction(() => {

                let nav = app.getActiveNavs()[0];
                let activeView = nav.getActive();

                if (activeView.name === "HomePage" || activeView.name === "LoginPage") {

                    if (nav.canGoBack()) { //Can we go back?
                        nav.pop();
                    } else {
                        const alert = this.alertCtrl.create({
                            title: 'Close App',
                            message: 'Do you want to exit?',
                            buttons: [{
                                text: 'Cancel',
                                role: 'cancel',
                                handler: () => {
                                    console.log('Application exit prevented!');
                                }
                            }, {
                                text: 'Close App',
                                handler: () => {
                                    this.platform.exitApp(); // Close this application
                                }
                            }]
                        });
                        alert.present();
                    }
                }
            });
        });
        this.pages = [
            { title: 'Stock In', component: HomePage },
            { title: 'Change Rack/Bin ', component: LocationChangePage }
        ];
    }
    openPage(page) {
        console.log('page component'+page.component);
        this.nav.push(page.component);
    }
}

```

app.html

```auto
<ion-menu [content]="content" enable-menu-with-back-views="true">
    <ion-header>
      <ion-toolbar>
        <ion-title>Menu</ion-title>
      </ion-toolbar>
    </ion-header>
  
    <ion-content>
      <ion-list>
        <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
          {{p.title}}
        </button>
      </ion-list>
    </ion-content>
  
  </ion-menu>
  
  <!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
  <ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>

```

sidemenu icon disappears after navigation.?

---

<div class="post-metadata">

**Author:** ![Rupnesh](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@Rupnesh](https://forum.ionicframework.com/u/Rupnesh)\
**Post date:** [December 31, 2018, 6:53am UTC](https://forum.ionicframework.com/t/sidemenu-navigation-icon-disappears-while-navigating-to-another-page/151669/2 "2018-12-31T06:53:06Z")

</div>

```auto
openPage(page) {
     console.log('page component'+page.component);
     //this.nav.push(page.component); instead of push page use setRoot
     this.nav.setRoot(page.component);
}

```

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:03pm UTC](https://forum.ionicframework.com/t/sidemenu-navigation-icon-disappears-while-navigating-to-another-page/151669/3 "2021-07-19T21:03:16Z")

</div>


