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.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]);