aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-10-02 15:39:09 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-10-02 15:39:09 +0200
commita6375e69668ea42e19531c6bc68dcd37f3f7cbd7 (patch)
tree03204a408d56311692c3528bedcf95d2455e94f2 /client/src/main.ts
parent052937db8a8d282eccdbdf38d487ed8d85d3c0a7 (diff)
parentc4403b29ad4db097af528a7f04eea07e0ed320d0 (diff)
downloadPeerTube-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.ts42
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 @@
1import { enableProdMode, provide } from '@angular/core'; 1import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2import { 2import { decorateModuleRef } from './app/environment';
3 HTTP_PROVIDERS, 3import { 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
7import { bootstrap } from '@angular/platform-browser-dynamic'; 7 */
8import { provideRouter } from '@angular/router'; 8import { AppModule } from './app';
9 9
10import { AppComponent } from './app/app.component'; 10/*
11import { routes } from './app/app.routes'; 11 * Bootstrap our Angular app with a top level NgModule
12import { AuthHttp, AuthService } from './app/shared'; 12 */
13 13export function main(): Promise<any> {
14if (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
18bootstrap(AppComponent, [ 20bootloader(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]);