X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.ts;h=70bf4853782ed6ac515d453e34b36ea955e0300a;hb=ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca;hp=f9c1d50b8f963efafbae056c8d861627d459919a;hpb=0629423ce335137ce77d1ee8fe30fc0eee36d83b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/main.ts b/client/src/main.ts index f9c1d50b8..70bf48537 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -1,12 +1,20 @@ -import { enableProdMode } from '@angular/core'; -import { bootstrap } from '@angular/platform-browser-dynamic'; -import { provideRouter } from '@angular/router'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { decorateModuleRef } from './app/environment'; +import { bootloader } from '@angularclass/hmr'; +/* + * App Module + * our top level module that holds all of our components + */ +import { AppModule } from './app'; -import { AppComponent } from './app/app.component'; -import { routes } from './app/app.routes'; - -if (process.env.ENV === 'production') { - enableProdMode(); +/* + * Bootstrap our Angular app with a top level NgModule + */ +export function main(): Promise { + return platformBrowserDynamic() + .bootstrapModule(AppModule) + .then(decorateModuleRef) + .catch(err => console.error(err)); } -bootstrap(AppComponent, [ provideRouter(routes) ]); +bootloader(main);