Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (didInitialize) {
console.warn('Ionic Angular was already initialized. Make sure IonicModule.forRoot() is just called once.');
}
didInitialize = true;
const Ionic = win.Ionic = win.Ionic || {};
Ionic.config = {
...config,
_zoneGate: (h: any) => zone.run(h)
};
const aelFn = '__zone_symbol__addEventListener' in (doc.body as any)
? '__zone_symbol__addEventListener'
: 'addEventListener';
return applyPolyfills().then(() => {
return defineCustomElements(win, {
exclude: ['ion-tabs', 'ion-tab'],
syncQueue: true,
raf,
jmp: (h: any) => zone.runOutsideAngular(h),
ael(elm, eventName, cb, opts) {
(elm as any)[aelFn](eventName, cb, opts);
},
rel(elm, eventName, cb, opts) {
elm.removeEventListener(eventName, cb, opts);
}
});
});
}
};
};
applyPolyfills().then(() => defineCustomElements(win));
applyPolyfills().then(() => defineCustomElements(win));
return (): any => {
const win: IonicWindow | undefined = doc.defaultView as any;
if (win) {
const Ionic = win.Ionic = win.Ionic || {};
Ionic.config = config;
return applyPolyfills().then(() => {
return defineCustomElements(win, {
exclude: ['ion-tabs', 'ion-tab'],
resourcesUrl: document.baseURI,
syncQueue: true,
raf: h => (win.__zone_symbol__requestAnimationFrame) ? win.__zone_symbol__requestAnimationFrame(h) : requestAnimationFrame(h),
ael(elm, eventName, cb, opts) {
if ((elm as any).__zone_symbol__addEventListener && skipZone(eventName)) {
(elm as any).__zone_symbol__addEventListener(eventName, cb, opts);
} else {
elm.addEventListener(eventName, cb, opts);
}
},
rel(elm, eventName, cb, opts) {
if ((elm as any).__zone_symbol__removeEventListener && skipZone(eventName)) {
(elm as any).__zone_symbol__removeEventListener(eventName, cb, opts);
} else {