diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-10-02 15:39:09 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-10-02 15:39:09 +0200 |
commit | a6375e69668ea42e19531c6bc68dcd37f3f7cbd7 (patch) | |
tree | 03204a408d56311692c3528bedcf95d2455e94f2 /client/src/main.ts | |
parent | 052937db8a8d282eccdbdf38d487ed8d85d3c0a7 (diff) | |
parent | c4403b29ad4db097af528a7f04eea07e0ed320d0 (diff) | |
download | PeerTube-a6375e69668ea42e19531c6bc68dcd37f3f7cbd7.tar.gz PeerTube-a6375e69668ea42e19531c6bc68dcd37f3f7cbd7.tar.zst PeerTube-a6375e69668ea42e19531c6bc68dcd37f3f7cbd7.zip |
Merge branch 'master' into webseed-merged
Diffstat (limited to 'client/src/main.ts')
-rw-r--r-- | client/src/main.ts | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/client/src/main.ts b/client/src/main.ts index a78d275ad..70bf48537 100644 --- a/client/src/main.ts +++ b/client/src/main.ts | |||
@@ -1,28 +1,20 @@ | |||
1 | import { enableProdMode, provide } from '@angular/core'; | 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; |
2 | import { | 2 | import { decorateModuleRef } from './app/environment'; |
3 | HTTP_PROVIDERS, | 3 | import { bootloader } from '@angularclass/hmr'; |
4 | RequestOptions, | 4 | /* |
5 | XHRBackend | 5 | * App Module |
6 | } from '@angular/http'; | 6 | * our top level module that holds all of our components |
7 | import { bootstrap } from '@angular/platform-browser-dynamic'; | 7 | */ |
8 | import { provideRouter } from '@angular/router'; | 8 | import { AppModule } from './app'; |
9 | 9 | ||
10 | import { AppComponent } from './app/app.component'; | 10 | /* |
11 | import { routes } from './app/app.routes'; | 11 | * Bootstrap our Angular app with a top level NgModule |
12 | import { AuthHttp, AuthService } from './app/shared'; | 12 | */ |
13 | 13 | export function main(): Promise<any> { | |
14 | if (process.env.ENV === 'production') { | 14 | return platformBrowserDynamic() |
15 | enableProdMode(); | 15 | .bootstrapModule(AppModule) |
16 | .then(decorateModuleRef) | ||
17 | .catch(err => console.error(err)); | ||
16 | } | 18 | } |
17 | 19 | ||
18 | bootstrap(AppComponent, [ | 20 | bootloader(main); |
19 | HTTP_PROVIDERS, | ||
20 | provide(AuthHttp, { | ||
21 | useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, authService: AuthService) => { | ||
22 | return new AuthHttp(backend, defaultOptions, authService); | ||
23 | }, | ||
24 | deps: [ XHRBackend, RequestOptions, AuthService ] | ||
25 | }), | ||
26 | AuthService, | ||
27 | provideRouter(routes) | ||
28 | ]); | ||