diff options
Diffstat (limited to 'client/src/main.ts')
-rw-r--r-- | client/src/main.ts | 20 |
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 @@ | |||
1 | import { enableProdMode } from '@angular/core'; | 1 | import { enableProdMode, provide } from '@angular/core'; |
2 | import { | ||
3 | HTTP_PROVIDERS, | ||
4 | RequestOptions, | ||
5 | XHRBackend | ||
6 | } from '@angular/http'; | ||
2 | import { bootstrap } from '@angular/platform-browser-dynamic'; | 7 | import { bootstrap } from '@angular/platform-browser-dynamic'; |
3 | import { provideRouter } from '@angular/router'; | 8 | import { provideRouter } from '@angular/router'; |
4 | 9 | ||
5 | import { AppComponent } from './app/app.component'; | 10 | import { AppComponent } from './app/app.component'; |
6 | import { routes } from './app/app.routes'; | 11 | import { routes } from './app/app.routes'; |
12 | import { AuthHttp, AuthService } from './app/shared'; | ||
7 | 13 | ||
8 | if (process.env.ENV === 'production') { | 14 | if (process.env.ENV === 'production') { |
9 | enableProdMode(); | 15 | enableProdMode(); |
10 | } | 16 | } |
11 | 17 | ||
12 | bootstrap(AppComponent, [ provideRouter(routes) ]); | 18 | bootstrap(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 | ]); | ||