mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
@ -69,9 +69,9 @@ export function ionicProviders(args: any = {}) {
|
|||||||
export function postBootstrap(appRef: ComponentRef, prodMode: boolean) {
|
export function postBootstrap(appRef: ComponentRef, prodMode: boolean) {
|
||||||
appRef.injector.get(TapClick);
|
appRef.injector.get(TapClick);
|
||||||
let app: IonicApp = appRef.injector.get(IonicApp);
|
let app: IonicApp = appRef.injector.get(IonicApp);
|
||||||
let platform = appRef.injector.get(Platform);
|
let platform: Platform = appRef.injector.get(Platform);
|
||||||
let zone = appRef.injector.get(NgZone);
|
platform.setZone(appRef.injector.get(NgZone));
|
||||||
platform.prepareReady(zone);
|
platform.prepareReady();
|
||||||
app.setProd(prodMode);
|
app.setProd(prodMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,13 @@ export class Platform {
|
|||||||
this._readyPromise = new Promise(res => { this._readyResolve = res; } );
|
this._readyPromise = new Promise(res => { this._readyResolve = res; } );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
setZone(zone: NgZone) {
|
||||||
|
this._zone = zone;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
// **********************************************
|
// **********************************************
|
||||||
@ -207,11 +214,10 @@ export class Platform {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
prepareReady(zone: NgZone) {
|
prepareReady() {
|
||||||
// this is the default prepareReady if it's not replaced by the engine
|
// this is the default prepareReady if it's not replaced by the engine
|
||||||
// if there was no custom ready method from the engine
|
// if there was no custom ready method from the engine
|
||||||
// then use the default DOM ready
|
// then use the default DOM ready
|
||||||
this._zone = zone;
|
|
||||||
ready(this.triggerReady.bind(this));
|
ready(this.triggerReady.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ Platform.register({
|
|||||||
swipeBackEnabled: isIOSDevice,
|
swipeBackEnabled: isIOSDevice,
|
||||||
swipeBackThreshold: 40,
|
swipeBackThreshold: 40,
|
||||||
tapPolyfill: isIOSDevice,
|
tapPolyfill: isIOSDevice,
|
||||||
virtualScrollEventAssist: !(window.indexedDB)
|
virtualScrollEventAssist: !(win.indexedDB)
|
||||||
},
|
},
|
||||||
isMatch(p: Platform): boolean {
|
isMatch(p: Platform): boolean {
|
||||||
return p.isPlatformMatch('ios', ['iphone', 'ipad', 'ipod'], ['windows phone']);
|
return p.isPlatformMatch('ios', ['iphone', 'ipad', 'ipod'], ['windows phone']);
|
||||||
@ -172,7 +172,7 @@ Platform.register({
|
|||||||
// 1) ionic bootstrapped
|
// 1) ionic bootstrapped
|
||||||
windowLoad(function() {
|
windowLoad(function() {
|
||||||
// 2) window onload triggered or completed
|
// 2) window onload triggered or completed
|
||||||
doc.addEventListener('deviceready', () => {
|
doc.addEventListener('deviceready', function() {
|
||||||
// 3) cordova deviceready event triggered
|
// 3) cordova deviceready event triggered
|
||||||
|
|
||||||
// add cordova listeners to fire platform events
|
// add cordova listeners to fire platform events
|
||||||
|
Reference in New Issue
Block a user