From 8fcd23312af33c1487d66375b78b66504ac9d635 Mon Sep 17 00:00:00 2001 From: Ashutosha Sahu Date: Mon, 7 Oct 2024 20:57:57 +0530 Subject: [PATCH] Added lazy loading.. --- src/app/app.routes.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 807156c..3b0b333 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,30 +1,24 @@ -import {Routes} from '@angular/router'; -import {HomeComponent} from './modules/home/pages/home/home.component'; -import {ShoppingListComponent} from './modules/shopping-list/pages/shopping-list/shopping-list.component'; -import { - AddProductsShoppingListComponent -} from './modules/shopping-list/pages/add-products-shopping-list/add-products-shopping-list.component'; -import {LoginComponent} from './modules/auth/pages/login/login.component'; +import { Routes } from '@angular/router'; export const routes: Routes = [ { path: 'shopping-list/:id/add-products', - component: AddProductsShoppingListComponent + loadComponent: () => import('./modules/shopping-list/pages/add-products-shopping-list/add-products-shopping-list.component').then(m => m.AddProductsShoppingListComponent) }, { path: 'shopping-list/:id', - component: ShoppingListComponent + loadComponent: () => import('./modules/shopping-list/pages/shopping-list/shopping-list.component').then(m => m.ShoppingListComponent) }, { path: 'shopping-list', - component: ShoppingListComponent + loadComponent: () => import('./modules/shopping-list/pages/shopping-list/shopping-list.component').then(m => m.ShoppingListComponent) }, { path: 'auth/login', - component: LoginComponent + loadComponent: () => import('./modules/auth/pages/login/login.component').then(m => m.LoginComponent) }, { path: '', - component: HomeComponent + loadComponent: () => import('./modules/home/pages/home/home.component').then(m => m.HomeComponent) } ];