feat(menu): push type. Fixes #380

This commit is contained in:
Max Lynch
2015-10-29 13:33:19 -05:00
parent a3b61b15e1
commit cd4f683ce5
7 changed files with 153 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
<ion-menu [content]="content" id="leftMenu">
<ion-menu [content]="content" id="leftMenu" side="left">
<ion-toolbar secondary>
<ion-title>Left Menu</ion-title>

View File

@@ -0,0 +1,27 @@
import {App, IonicApp, Page} from 'ionic/ionic';
@Page({templateUrl: 'page1.html'})
class Page1 {}
@App({
templateUrl: 'main.html'
})
class E2EApp {
constructor(app: IonicApp) {
this.app = app;
this.rootView = Page1;
}
openPage(menu, page) {
// close the menu when clicking a link from the menu
menu.close();
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
let nav = this.app.getComponent('nav');
nav.setRoot(page.component);
}
}

View File

@@ -0,0 +1,41 @@
<ion-menu [content]="content" id="leftMenu" type="push" side="left">
<ion-toolbar secondary>
<ion-title>Left Menu</ion-title>
</ion-toolbar>
<ion-content>
<ion-list>
<button ion-item menu-toggle="leftMenu" detail-none>
Close Left Menu
</button>
</ion-list>
</ion-content>
</ion-menu>
<!-- <ion-menu [content]="content" id="rightMenu" type="reveal" side="right">
<ion-toolbar secondary>
<ion-title>Right Menu</ion-title>
</ion-toolbar>
<ion-content>
<ion-list>
<button ion-item menu-toggle="rightMenu">
Close Right Menu
</button>
</ion-list>
</ion-content>
</ion-menu> -->
<ion-nav id="nav" [root]="rootView" #content swipe-back-enabled="false"></ion-nav>

View File

@@ -0,0 +1,29 @@
<ion-navbar *navbar>
<a menu-toggle="leftMenu">
<icon menu></icon>
</a>
<ion-title>
Push Menu
</ion-title>
</ion-navbar>
<ion-content #content padding>
<h3>Content</h3>
<p>
<button menu-toggle="leftMenu">Toggle Left Menu</button>
</p>
<p>
<button menu-toggle="rightMenu">Toggle Right Menu</button>
</p>
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
</ion-content>