Skip to content

Commit 9bf51e6

Browse files
committed
refactor: migration to lazy-loaded routes
1 parent c9f9a7f commit 9bf51e6

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/app/app.routes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Routes } from '@angular/router';
2-
import { DefaultLayoutComponent } from './layout';
32

43
export const routes: Routes = [
54
{
@@ -9,7 +8,7 @@ export const routes: Routes = [
98
},
109
{
1110
path: '',
12-
component: DefaultLayoutComponent,
11+
loadComponent: () => import('./layout').then(m => m.DefaultLayoutComponent),
1312
data: {
1413
title: 'Home'
1514
},

src/app/views/base/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const routes: Routes = [
8484
},
8585
{
8686
path: 'progress',
87-
loadComponent: () => import('./progress/progress.component').then(m => m.ProgressComponent),
87+
loadComponent: () => import('./progress/progress.component').then(m => m.AppProgressComponent),
8888
data: {
8989
title: 'Progress'
9090
}

src/app/views/charts/routes.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import { Routes } from '@angular/router';
22

3-
import { ChartsComponent } from './charts.component';
4-
5-
export const routes: Routes = [
6-
{
7-
path: '',
8-
component: ChartsComponent,
9-
data: {
10-
title: 'Charts'
11-
}
3+
export const routes: Routes = [{
4+
path: '', loadComponent: () => import('./charts.component').then(m => m.ChartsComponent), data: {
5+
title: 'Charts'
126
}
13-
];
7+
}];

0 commit comments

Comments
 (0)