]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - client/src/main.ts
Fix table header overflow
[github/Chocobozzz/PeerTube.git] / client / src / main.ts
... / ...
CommitLineData
1import { ApplicationRef, enableProdMode } from '@angular/core'
2import { enableDebugTools } from '@angular/platform-browser'
3import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
4import { AppModule } from './app/app.module'
5import { environment } from './environments/environment'
6
7if (environment.production) {
8 enableProdMode()
9}
10
11const bootstrap = () => platformBrowserDynamic()
12 .bootstrapModule(AppModule)
13 .then(bootstrapModule => {
14 if ('serviceWorker' in navigator && environment.production) {
15 navigator.serviceWorker.register('/ngsw-worker.js')
16 .catch(err => console.error('Cannot register service worker.', err))
17 }
18
19 if (!environment.production) {
20 const applicationRef = bootstrapModule.injector.get(ApplicationRef)
21 const componentRef = applicationRef.components[0]
22
23 // allows to run `ng.profiler.timeChangeDetection();`
24 enableDebugTools(componentRef)
25 }
26
27 return bootstrapModule
28 })
29 .catch(err => {
30 console.error(err)
31 return null
32 })
33
34bootstrap()