X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.ts;h=a78d275ad4029191b3d1db1c460f4f3aba4b4ea5;hb=bd5c83a8cb46eb6da2b25df3b1f6a2a5795d1869;hp=f9c1d50b8f963efafbae056c8d861627d459919a;hpb=2f372a865487427ff97ad17edd0e6adfbb478c80;p=github%2FChocobozzz%2FPeerTube.git 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 @@ -import { enableProdMode } from '@angular/core'; +import { enableProdMode, provide } from '@angular/core'; +import { + HTTP_PROVIDERS, + RequestOptions, + XHRBackend +} from '@angular/http'; import { bootstrap } from '@angular/platform-browser-dynamic'; import { provideRouter } from '@angular/router'; import { AppComponent } from './app/app.component'; import { routes } from './app/app.routes'; +import { AuthHttp, AuthService } from './app/shared'; if (process.env.ENV === 'production') { enableProdMode(); } -bootstrap(AppComponent, [ provideRouter(routes) ]); +bootstrap(AppComponent, [ + HTTP_PROVIDERS, + provide(AuthHttp, { + useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, authService: AuthService) => { + return new AuthHttp(backend, defaultOptions, authService); + }, + deps: [ XHRBackend, RequestOptions, AuthService ] + }), + AuthService, + provideRouter(routes) +]);