I am trying to create a simple navbar menu with ionic2. I followed tut, but it will not work in my application, and I cannot understand why. This is the current code I have: app.ts
import {App, Platform} from 'ionic-angular';
import {TabsPage} from './pages/tabs/tabs';
import {MenuPage} from './pages/menu/menu';
@App({
templateUrl: 'build/index.html',
config: {}
})
export class MyApp {
static get parameters() {
return [[Platform]];
}
constructor(platform) {
this.rootPage = TabsPage;
platform.ready().then(() => {
});
}
}
index.html
<ion-nav #content [root]="rootPage"></ion-nav>
menu.ts:
import{Page, MenuController} from 'ionic-angular';
@Page({
templateUrl: 'build/pages/menu/menu.html'
})
export class MenuPage {
constructor(menu: MenuController) {
this.menu = menu;
}
openMenu() {
this.menu.open();
}
}
menu.html:
<ion-menu persistent="true" [content]="content">
<ion-toolbar>
<ion-title>Instellingen</ion-title>
</ion-toolbar>
<ion-content>
<ion-list>
<button ion-item>
Informatie
</button>
<button ion-item>
Veelgestelde vragen
</button>
<button ion-item>
Algemene Voorwaarden
</button>
</ion-list>
</ion-content>
</ion-menu>
As for the documentation, this should work ... but in my case it will not, so will someone see what I am missing?
No errors, I do not see any problems with normally loaded loads. There is simply no menu, and I followed the launch of toturial
source
share