]>
Commit | Line | Data |
---|---|---|
68f6c87a C |
1 | import { ApplicationRef, enableProdMode } from '@angular/core' |
2 | import { enableDebugTools } from '@angular/platform-browser' | |
b6827820 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' |
b6827820 C |
4 | import { AppModule } from './app/app.module' |
5 | import { environment } from './environments/environment' | |
42b40636 | 6 | import { logger } from './root-helpers' |
63c4db6d C |
7 | |
8 | if (environment.production) { | |
b6827820 | 9 | enableProdMode() |
63c4db6d C |
10 | } |
11 | ||
42b40636 C |
12 | logger.registerServerSending(environment.apiUrl) |
13 | ||
77d07d69 | 14 | const bootstrap = () => platformBrowserDynamic() |
361dcebc | 15 | .bootstrapModule(AppModule) |
78967fca | 16 | .then(bootstrapModule => { |
68f6c87a C |
17 | if (!environment.production) { |
18 | const applicationRef = bootstrapModule.injector.get(ApplicationRef) | |
19 | const componentRef = applicationRef.components[0] | |
20 | ||
21 | // allows to run `ng.profiler.timeChangeDetection();` | |
22 | enableDebugTools(componentRef) | |
23 | } | |
24 | ||
78967fca C |
25 | return bootstrapModule |
26 | }) | |
27 | .catch(err => { | |
42b40636 | 28 | logger.error(err) |
78967fca C |
29 | return null |
30 | }) | |
77d07d69 | 31 | |
4f926722 | 32 | bootstrap() |