diff --git a/src/web/src/environments/development/bootstrap-app.ts b/src/web/src/environments/development/bootstrap-app.ts index 65de02d4..c1088bef 100644 --- a/src/web/src/environments/development/bootstrap-app.ts +++ b/src/web/src/environments/development/bootstrap-app.ts @@ -8,26 +8,23 @@ import {getZoneNameBoundWebLogger} from "src/web/src/util"; const logger = getZoneNameBoundWebLogger("[environments/development/bootstrap-app]"); -// TODO get rid of "onload" handler, see https://github.com/electron/electron/issues/17526 -window.addEventListener("load", () => { - bootloader(async () => { - try { - const ngModuleRef = await platformBrowserDynamic().bootstrapModule(AppModule); - const applicationRef = ngModuleRef.injector.get(ApplicationRef); - const componentRef = applicationRef.components[0]; +bootloader(async () => { + try { + const ngModuleRef = await platformBrowserDynamic().bootstrapModule(AppModule); + const applicationRef = ngModuleRef.injector.get(ApplicationRef); + const componentRef = applicationRef.components[0]; - enableDebugTools(componentRef); + enableDebugTools(componentRef); - if (!module.hot) { - throw new Error("webpack-dev-server: HMR is not enabled"); - } - - return hmrModule(ngModuleRef, module); - } catch (error) { - // tslint:disable-next-line:no-console - console.error(error); - logger.error(error); - throw error; + if (!module.hot) { + throw new Error("webpack-dev-server: HMR is not enabled"); } - }); + + return hmrModule(ngModuleRef, module); + } catch (error) { + // tslint:disable-next-line:no-console + console.error(error); + logger.error(error); + throw error; + } }); diff --git a/src/web/src/environments/production/bootstrap-app.ts b/src/web/src/environments/production/bootstrap-app.ts index c14fb64a..062c1f46 100644 --- a/src/web/src/environments/production/bootstrap-app.ts +++ b/src/web/src/environments/production/bootstrap-app.ts @@ -6,16 +6,13 @@ import {getZoneNameBoundWebLogger} from "src/web/src/util"; const logger = getZoneNameBoundWebLogger("[environments/production/bootstrap-app]"); -// TODO get rid of "onload" handler, see https://github.com/electron/electron/issues/17526 -window.addEventListener("load", () => { - enableProdMode(); +enableProdMode(); - platformBrowserDynamic() - .bootstrapModule(AppModule) - .catch((error) => { - // tslint:disable-next-line:no-console - console.error(error); - logger.error(error); - throw error; - }); -}); +platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch((error) => { + // tslint:disable-next-line:no-console + console.error(error); + logger.error(error); + throw error; + });