How to use the @ionic/core/loader.applyPolyfills function in @ionic/core

To help you get started, we’ve selected a few @ionic/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionic-team / ionic / angular / src / app-initialize.ts View on Github external
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);
          }
        });
      });
    }
  };
};
github ionic-team / ionic / vue / src / app-initialize.ts View on Github external
  applyPolyfills().then(() => defineCustomElements(win));
github ModusCreateOrg / ionic-vue / src / app-initialize.ts View on Github external
  applyPolyfills().then(() => defineCustomElements(win));
github ionic-team / ionic / angular / src / app-initialize.ts View on Github external
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 {