mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user