@@ -18,7 +18,8 @@ import {
18
18
} from '@angularclass/hmr' ;
19
19
import {
20
20
RouterModule ,
21
- PreloadAllModules
21
+ PreloadAllModules ,
22
+
22
23
} from '@angular/router' ;
23
24
24
25
/*
@@ -34,7 +35,7 @@ import { AppState, InternalStateType } from './app.service';
34
35
import { AboutComponent } from './about' ;
35
36
import { ErrorPageComponent } from './errorpage' ;
36
37
import { LoginComponent } from './login' ;
37
- import { LogoutComponent } from './logout' ;
38
+ // import { LogoutComponent } from './logout';
38
39
import { RootComponent } from './root' ;
39
40
import { DashboardComponent } from './dashboard'
40
41
import { ConfirmDialog } from './shared'
@@ -45,9 +46,10 @@ import { ConfirmDialog} from './shared'
45
46
import { ChartsModule } from 'ng2-charts' ;
46
47
import { RootModule } from './root' ;
47
48
import { CustomerModule } from './customer' ;
48
- // import { ProductModule } from './products';
49
- // import { SharedModule } from './shared';
50
- import { AuthGuard } from './_guard' ;
49
+
50
+ import { AppPreloader } from './app.preloader' ;
51
+
52
+ import { AuthGuard } from './_guard' ;
51
53
import { BackendService , AuthenticationService , PagerService } from './_services' ;
52
54
// import { } from '../_services';
53
55
// import { BackendService, AlertService, AuthenticationService, UserService } from './_services';
@@ -82,13 +84,11 @@ type StoreType = {
82
84
ErrorPageComponent ,
83
85
// XLargeDirective,
84
86
LoginComponent ,
85
- LogoutComponent ,
87
+ // LogoutComponent,
86
88
RootComponent ,
87
89
DashboardComponent ,
88
90
ConfirmDialog ,
89
-
90
- // StarComponent
91
- // AlertComponent
91
+
92
92
] ,
93
93
/**
94
94
* Import Angular's modules.
@@ -100,11 +100,9 @@ type StoreType = {
100
100
FormsModule ,
101
101
HttpModule ,
102
102
ChartsModule ,
103
- NgProgressModule ,
104
- RouterModule . forRoot ( ROUTES , { preloadingStrategy : PreloadAllModules } ) ,
105
- // NgProgressBrowserXhr,
106
- // RouterModule.forRoot(ROUTES, { useHash: true, preloadingStrategy: PreloadAllModules }),
107
- // ProductModule,
103
+ NgProgressModule ,
104
+ // RouterModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules }),
105
+ RouterModule . forRoot ( ROUTES , { preloadingStrategy : AppPreloader , initialNavigation :false } ) ,
108
106
CustomerModule ,
109
107
RootModule ,
110
108
@@ -115,6 +113,8 @@ type StoreType = {
115
113
*/
116
114
providers : [
117
115
AuthGuard ,
116
+
117
+ AppPreloader ,
118
118
BackendService ,
119
119
AuthenticationService ,
120
120
PagerService ,
@@ -129,13 +129,7 @@ export class AppModule {
129
129
public appRef : ApplicationRef ,
130
130
public appState : AppState ,
131
131
private progress : NgProgressService
132
- ) {
133
-
134
- // console.log('AppModule ...')
135
- // let http = <Http>{}
136
- // console.log(this.http)
137
- // this.http.get("http://localhost:5354/token");
138
- }
132
+ ) { }
139
133
140
134
public hmrOnInit ( store : StoreType ) {
141
135
if ( ! store || ! store . state ) {
0 commit comments