aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-09-06 22:40:57 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-09-06 22:40:57 +0200
commitab32b0fc805b92c5a1d7ac5901cb1a38e94622ca (patch)
tree1749a7390cf0a726a179c5fa554053f5c0f0e51c /client/src/main.ts
parent088a967fe0bc285aa7811515f6a9655e1144b9f9 (diff)
downloadPeerTube-ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca.tar.gz
PeerTube-ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca.tar.zst
PeerTube-ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca.zip
Dirty update to Angular RC6
Diffstat (limited to 'client/src/main.ts')
-rw-r--r--client/src/main.ts49
1 files changed, 17 insertions, 32 deletions
diff --git a/client/src/main.ts b/client/src/main.ts
index 7caabe914..70bf48537 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -1,35 +1,20 @@
1import { enableProdMode, provide } from '@angular/core'; 1import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2import { disableDeprecatedForms, provideForms } from '@angular/forms'; 2import { decorateModuleRef } from './app/environment';
3import { 3import { bootloader } from '@angularclass/hmr';
4 HTTP_PROVIDERS, 4/*
5 RequestOptions, 5 * App Module
6 XHRBackend 6 * our top level module that holds all of our components
7} from '@angular/http'; 7 */
8import { bootstrap } from '@angular/platform-browser-dynamic'; 8import { AppModule } from './app';
9import { provideRouter } from '@angular/router';
10 9
11import { routes } from './app/app.routes'; 10/*
12import { AuthHttp, AuthService, RestExtractor } from './app/shared'; 11 * Bootstrap our Angular app with a top level NgModule
13import { AppComponent } from './app/app.component'; 12 */
14 13export function main(): Promise<any> {
15if (process.env.ENV === 'production') { 14 return platformBrowserDynamic()
16 enableProdMode(); 15 .bootstrapModule(AppModule)
16 .then(decorateModuleRef)
17 .catch(err => console.error(err));
17} 18}
18 19
19bootstrap(AppComponent, [ 20bootloader(main);
20 HTTP_PROVIDERS,
21 provide(AuthHttp, {
22 useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, authService: AuthService) => {
23 return new AuthHttp(backend, defaultOptions, authService);
24 },
25 deps: [ XHRBackend, RequestOptions, AuthService ]
26 }),
27
28 AuthService,
29 RestExtractor,
30
31 provideRouter(routes),
32
33 disableDeprecatedForms(),
34 provideForms()
35]);