diff --git a/ionic/components/app/app.ts b/ionic/components/app/app.ts index 50b23b1f35..313d799d62 100644 --- a/ionic/components/app/app.ts +++ b/ionic/components/app/app.ts @@ -83,6 +83,14 @@ export class IonicApp { this._zone.run(fn); } + /** + * TODO + * @param {Function} fn TODO + */ + zoneRunOutside(fn) { + this._zone.runOutsideAngular(fn); + } + /** * Register a known component with a key, for easy lookups later. * @param {TODO} key The key to use to register the component diff --git a/ionic/components/overlay/overlay.ts b/ionic/components/overlay/overlay.ts index 49f74ce299..c94fe57e24 100644 --- a/ionic/components/overlay/overlay.ts +++ b/ionic/components/overlay/overlay.ts @@ -75,6 +75,8 @@ export class Overlay { export class OverlayRef { constructor(app, overlayType, opts, ref, context) { + this.app = app; + let overlayInstance = (ref && ref.instance); if (!overlayInstance) return; @@ -127,12 +129,21 @@ export class OverlayRef { ClickBlock(true, animation.duration() + 200); - animation.play().then(() => { - ClickBlock(false); - animation.dispose(); - instance.viewDidEnter && instance.viewDidEnter(); - resolve(); + this.app.zoneRunOutside(() => { + + animation.play().then(() => { + + this.app.zoneRun(() => { + ClickBlock(false); + animation.dispose(); + instance.viewDidEnter && instance.viewDidEnter(); + resolve(); + }); + + }); + }); + }).catch(err => { console.error(err); });