Navigate from side menu to another pages

I’m trying to navigate from the side menu to other pages but didn’t work
every time I got pushSettingsPage is not defined
where it shouled load the function from ?
app.html


main.ts

Hey @a7mdFo2ad, try writing the pushsettingspage function in you component.ts file

can’t inject nav controller in the constructor !

For nav, do like this:

import { Nav } from 'ionic-angular';

export class YourApp {
  @ViewChild(Nav) nav: Nav; //no need to inject in constructor
 
  openPage() {
      this.nav.push(yourPage);
  }

I hope this will help.

thank you …worked but still side menu opened

Sorry, didn’t get what you are saying. Can you elaborate a little?

I hope this will help

worked when i try to navigate to another page but side menu still opened
and it should close after open another page

Gotcha. Just add menuClose attribute where you are calling the click function. Just like this:

<ion-item menuClose class="menu-items" onclick="pushSettingsPage()">

Just add menuClose and you are good to go. Let me know if it helps!

thank you man :slight_smile:

Np buddy. Glad to help :slight_smile: