mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
@ -1,4 +1,4 @@
|
||||
import {Component, forwardRef, Directive, Host, EventEmitter, ElementRef} from 'angular2/core';
|
||||
import {Component, forwardRef, Directive, Host, EventEmitter, ElementRef, NgZone} from 'angular2/core';
|
||||
|
||||
import {Ion} from '../ion';
|
||||
import {IonicApp} from '../app/app';
|
||||
@ -113,16 +113,14 @@ import * as gestures from './menu-gestures';
|
||||
export class Menu extends Ion {
|
||||
|
||||
constructor(
|
||||
app: IonicApp,
|
||||
elementRef: ElementRef,
|
||||
config: Config,
|
||||
platform: Platform,
|
||||
keyboard: Keyboard
|
||||
private app: IonicApp,
|
||||
private platform: Platform,
|
||||
private keyboard: Keyboard,
|
||||
private zone: NgZone
|
||||
) {
|
||||
super(elementRef, config);
|
||||
this.app = app;
|
||||
this.platform = platform;
|
||||
this.keyboard = keyboard;
|
||||
|
||||
this.opening = new EventEmitter('opening');
|
||||
this.isOpen = false;
|
||||
@ -177,6 +175,7 @@ export class Menu extends Ion {
|
||||
* @private
|
||||
*/
|
||||
_initGesture() {
|
||||
this.zone.runOutsideAngular(() => {
|
||||
switch(this.side) {
|
||||
case 'right':
|
||||
this._gesture = new gestures.RightMenuGesture(this);
|
||||
@ -187,6 +186,7 @@ export class Menu extends Ion {
|
||||
break;
|
||||
}
|
||||
this._targetGesture = new gestures.TargetGesture(this);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,6 +40,7 @@ class E2EApp {
|
||||
constructor(app: IonicApp) {
|
||||
this.app = app;
|
||||
this.rootView = Page1;
|
||||
this.changeDectionCount = 0;
|
||||
|
||||
this.pages = [
|
||||
{ title: 'Page 1', component: Page1 },
|
||||
@ -62,4 +63,9 @@ class E2EApp {
|
||||
onMenuOpening(ev) {
|
||||
console.log('onMenuOpening', ev);
|
||||
}
|
||||
|
||||
isHidden() {
|
||||
console.log('Change detection', ++this.changeDectionCount);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
{{p.title}}
|
||||
</button>
|
||||
|
||||
<button ion-item menuClose="leftMenu" detail-none>
|
||||
<button ion-item menuClose="leftMenu" detail-none [hidden]="isHidden()">
|
||||
Close Menu
|
||||
</button>
|
||||
|
||||
|
Reference in New Issue
Block a user