Side menu not working


#1

after login i want to show side menu . but it is not showing

ts code

import { Component,ViewChild } from '@angular/core';
import { NavController, NavParams ,Nav,Platform} from 'ionic-angular';
import {ShopPage} from '../shop/shop';
import {HomePage} from '../home/home';
/*
  Generated class for the Menu page.

  See http://ionicframework.com/docs/v2/components/#navigation for more info on
  Ionic pages and navigation.
*/
@Component({
  selector: 'page-menu',
  templateUrl: 'menu.html'
})
export class MenuPage {
  @ViewChild(Nav) nav: Nav;

    rootPage: any = HomePage;

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

 constructor(public platform: Platform) {
    this.initializeApp();

    // used for an example of ngFor and navigation
    this.pages = [
      { title: 'Shop', component: ShopPage }
    ];
    console.log("try")

  }

  initializeApp() {
    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      
    });
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad MenuPage');
  }
openPage(page) {
        // Reset the content nav to have just this page
        // we wouldn't want the back button to show in this scenario
        this.nav.setRoot(page.component);
    }
}

html

<ion-menu [content]="content">

    <ion-toolbar>
        <ion-title>Menu</ion-title>
    </ion-toolbar>

    <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>

#2

still unable to solve it. wt is the mistake in my side