mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 03:00:58 +08:00
fix(angular): use initialize function when setting up ionic angular to avoid config errors (#24004)
resolves #22853 Co-authored-by: Liam DeBeasi <liamdebeasi@icloud.com>
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
import { NgZone } from '@angular/core';
|
import { NgZone } from '@angular/core';
|
||||||
|
import { initialize } from '@ionic/core';
|
||||||
import { applyPolyfills, defineCustomElements } from '@ionic/core/loader';
|
import { applyPolyfills, defineCustomElements } from '@ionic/core/loader';
|
||||||
|
|
||||||
import { Config } from './providers/config';
|
import { Config } from './providers/config';
|
||||||
@ -9,12 +10,11 @@ export const appInitialize = (config: Config, doc: Document, zone: NgZone) => {
|
|||||||
return (): any => {
|
return (): any => {
|
||||||
const win: IonicWindow | undefined = doc.defaultView as any;
|
const win: IonicWindow | undefined = doc.defaultView as any;
|
||||||
if (win && typeof (window as any) !== 'undefined') {
|
if (win && typeof (window as any) !== 'undefined') {
|
||||||
const Ionic = win.Ionic = win.Ionic || {};
|
|
||||||
|
|
||||||
Ionic.config = {
|
initialize({
|
||||||
...config,
|
...config,
|
||||||
_zoneGate: (h: any) => zone.run(h)
|
_zoneGate: (h: any) => zone.run(h)
|
||||||
};
|
});
|
||||||
|
|
||||||
const aelFn = '__zone_symbol__addEventListener' in (doc.body as any)
|
const aelFn = '__zone_symbol__addEventListener' in (doc.body as any)
|
||||||
? '__zone_symbol__addEventListener'
|
? '__zone_symbol__addEventListener'
|
||||||
|
Reference in New Issue
Block a user