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.ts42
1 files changed, 17 insertions, 25 deletions
diff --git a/client/src/main.ts b/client/src/main.ts
index a78d275ad..70bf48537 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -1,28 +1,20 @@
1import { enableProdMode, provide } from '@angular/core'; 1import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2import { 2import { decorateModuleRef } from './app/environment';
3 HTTP_PROVIDERS, 3import { bootloader } from '@angularclass/hmr';
4 RequestOptions, 4/*
5 XHRBackend 5 * App Module
6} from '@angular/http'; 6 * our top level module that holds all of our components
7import { bootstrap } from '@angular/platform-browser-dynamic'; 7 */
8import { provideRouter } from '@angular/router'; 8import { AppModule } from './app';
9 9
10import { AppComponent } from './app/app.component'; 10/*
11import { routes } from './app/app.routes'; 11 * Bootstrap our Angular app with a top level NgModule
12import { AuthHttp, AuthService } from './app/shared'; 12 */
13 13export function main(): Promise<any> {
14if (process.env.ENV === 'production') { 14 return platformBrowserDynamic()
15 enableProdMode(); 15 .bootstrapModule(AppModule)
16 .then(decorateModuleRef)
17 .catch(err => console.error(err));
16} 18}
17 19
18bootstrap(AppComponent, [ 20bootloader(main);
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]);