aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/main.ts')
-rw-r--r--client/src/main.ts20
1 files changed, 18 insertions, 2 deletions
diff --git a/client/src/main.ts b/client/src/main.ts
index f9c1d50b8..a78d275ad 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -1,12 +1,28 @@
1import { enableProdMode } from '@angular/core'; 1import { enableProdMode, provide } from '@angular/core';
2import {
3 HTTP_PROVIDERS,
4 RequestOptions,
5 XHRBackend
6} from '@angular/http';
2import { bootstrap } from '@angular/platform-browser-dynamic'; 7import { bootstrap } from '@angular/platform-browser-dynamic';
3import { provideRouter } from '@angular/router'; 8import { provideRouter } from '@angular/router';
4 9
5import { AppComponent } from './app/app.component'; 10import { AppComponent } from './app/app.component';
6import { routes } from './app/app.routes'; 11import { routes } from './app/app.routes';
12import { AuthHttp, AuthService } from './app/shared';
7 13
8if (process.env.ENV === 'production') { 14if (process.env.ENV === 'production') {
9 enableProdMode(); 15 enableProdMode();
10} 16}
11 17
12bootstrap(AppComponent, [ provideRouter(routes) ]); 18bootstrap(AppComponent, [
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]);