I want to navigate on each side menu items in a click event.
app.html
<ion-menu [content]="content">
<ion-header>
<ion-toolbar>
<ion-title>Pages</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>
<ion-nav #content [root]="rootPage"></ion-nav>
app.component.ts
rootPage = FirstRunPage;
@ViewChild('content') nav: NavController
controller() {
}
openPage(page) {
this.nav.setRoot(page.component);
}
I have imported import { Platform, NavController, Nav } from 'ionic-angular';
But shows error message