Skip to content

Commit 834c54a

Browse files
committed
refactor(router): update lazy-loading imports
1 parent 081eee9 commit 834c54a

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@
7474
"tslint-config-airbnb": "5.9.2",
7575
"typescript": "3.5.3"
7676
}
77-
}
77+
}

src/app/app-routing.module.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import { DashboardComponent } from './pages/dashboard';
99
import { Dashboard2Component } from './pages/dashboard2';
1010
import { FormsComponent } from './pages/forms';
1111

12+
// @ts-ignore
13+
// @ts-ignore
14+
// @ts-ignore
1215
@NgModule({
1316
imports: [
1417
RouterModule.forRoot(
@@ -20,11 +23,11 @@ import { FormsComponent } from './pages/forms';
2023
{ path: 'forms', component: FormsComponent, pathMatch: 'full' },
2124
{ path: 'charts', component: ChartsComponent, pathMatch: 'full' },
2225
{ path: 'components', component: ComponentsComponent, pathMatch: 'full' },
23-
{ path: '**', redirectTo: '/pages/404' },
26+
{ path: '**', redirectTo: '/ypages/404' },
2427
] }, // add 'canActivate: AuthGuard' for catching unauth users
25-
{ path: 'ui', loadChildren: './pages/ui/ui.module#UIModule' },
26-
{ path: 'maps', loadChildren: './pages/maps/maps.module#MapsModule' },
27-
{ path: 'pages', loadChildren: './pages/pages/pages.module#PagesModule' },
28+
{ path: 'ui', loadChildren: () => import('./pages/ui/ui.module').then(m => m.UIModule) },
29+
{ path: 'maps', loadChildren: () => import('./pages/maps/maps.module').then(m => m.MapsModule) },
30+
{ path: 'pages', loadChildren: () => import('./pages/pages/pages.module').then(m => m.PagesModule) },
2831
{ path: '**', redirectTo: '/pages/404' },
2932
],
3033
{ useHash: true },

src/tsconfig.app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"outDir": "../out-tsc/app",
55
"baseUrl": "./",
6-
"module": "es2015",
6+
//"module": "es2015",
77
"types": ["d3", "nvd3", "material-design-lite"]
88
}
99
}

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"sourceMap": true,
77
"declaration": false,
88
"moduleResolution": "node",
9+
"module": "esnext",
910
"emitDecoratorMetadata": true,
1011
"experimentalDecorators": true,
1112
"downlevelIteration": true,

0 commit comments

Comments
 (0)