X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.ts;h=7c058e12fd165a77e993f602a1c23feb8f3857c0;hb=def16d33d19153c6583fa8a30634760b3d64d34c;hp=f9c1d50b8f963efafbae056c8d861627d459919a;hpb=0629423ce335137ce77d1ee8fe30fc0eee36d83b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/main.ts b/client/src/main.ts index f9c1d50b8..7c058e12f 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -1,12 +1,34 @@ -import { enableProdMode } from '@angular/core'; +import { enableProdMode, provide } from '@angular/core'; +import { disableDeprecatedForms, provideForms } from '@angular/forms'; +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'; +import { AppComponent } from './app/app.component'; 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), + + disableDeprecatedForms(), + provideForms() +]);