diff --git a/ionic/config/bootstrap.ts b/ionic/config/bootstrap.ts index d202c9d98a..574bdef1c1 100644 --- a/ionic/config/bootstrap.ts +++ b/ionic/config/bootstrap.ts @@ -69,9 +69,9 @@ export function ionicProviders(args: any = {}) { export function postBootstrap(appRef: ComponentRef, prodMode: boolean) { appRef.injector.get(TapClick); let app: IonicApp = appRef.injector.get(IonicApp); - let platform = appRef.injector.get(Platform); - let zone = appRef.injector.get(NgZone); - platform.prepareReady(zone); + let platform: Platform = appRef.injector.get(Platform); + platform.setZone(appRef.injector.get(NgZone)); + platform.prepareReady(); app.setProd(prodMode); } diff --git a/ionic/platform/platform.ts b/ionic/platform/platform.ts index 8a64fc308b..119bae2fcd 100644 --- a/ionic/platform/platform.ts +++ b/ionic/platform/platform.ts @@ -48,6 +48,13 @@ export class Platform { this._readyPromise = new Promise(res => { this._readyResolve = res; } ); } + /** + * @private + */ + setZone(zone: NgZone) { + this._zone = zone; + } + // Methods // ********************************************** @@ -207,11 +214,10 @@ export class Platform { /** * @private */ - prepareReady(zone: NgZone) { + prepareReady() { // this is the default prepareReady if it's not replaced by the engine // if there was no custom ready method from the engine // then use the default DOM ready - this._zone = zone; ready(this.triggerReady.bind(this)); } diff --git a/ionic/platform/registry.ts b/ionic/platform/registry.ts index f4d0a56c3c..ab6b7e6e83 100644 --- a/ionic/platform/registry.ts +++ b/ionic/platform/registry.ts @@ -106,7 +106,7 @@ Platform.register({ swipeBackEnabled: isIOSDevice, swipeBackThreshold: 40, tapPolyfill: isIOSDevice, - virtualScrollEventAssist: !(window.indexedDB) + virtualScrollEventAssist: !(win.indexedDB) }, isMatch(p: Platform): boolean { return p.isPlatformMatch('ios', ['iphone', 'ipad', 'ipod'], ['windows phone']); @@ -172,7 +172,7 @@ Platform.register({ // 1) ionic bootstrapped windowLoad(function() { // 2) window onload triggered or completed - doc.addEventListener('deviceready', () => { + doc.addEventListener('deviceready', function() { // 3) cordova deviceready event triggered // add cordova listeners to fire platform events