1 import { ApplicationRef, enableProdMode } from '@angular/core'
2 import { enableDebugTools } from '@angular/platform-browser'
3 import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
4 import { AppModule } from './app/app.module'
5 import { environment } from './environments/environment'
6 import { logger } from './root-helpers'
8 if (environment.production) {
12 logger.registerServerSending(environment.apiUrl)
14 const bootstrap = () => platformBrowserDynamic()
15 .bootstrapModule(AppModule)
16 .then(bootstrapModule => {
17 if (!environment.production) {
18 const applicationRef = bootstrapModule.injector.get(ApplicationRef)
19 const componentRef = applicationRef.components[0]
21 // allows to run `ng.profiler.timeChangeDetection();`
22 enableDebugTools(componentRef)
25 return bootstrapModule
31 console.error('Cannot log error', { err, err2 })
34 // Ensure we display an "incompatible message" on Angular bootstrap error
36 if (document.querySelector('my-app').innerHTML === '') {