0 votes
in Angular by

Which code shows utilizing lazy loading for the new item feature module in the app.module.ts.file?

1. const newItemRoutes: Routes = (

     { 

          path: "add",

          loadchildren: () => import("./new-item/new-item.module").then(m => m.NewItemModule)

     },

     { path: ":medium", component: MediaItemListComponent },

     { path: ' ', pathMatch: 'full', redirectTo: 'all' }

);

2. const newItemRoutes: Routes = [

     { 

          path: 'add',

          loadchildren: () => import('./new-item/new-item.module').then(m => m.NewItemModule)

     },

     { path: ':medium', component: MediaItemListComponent },

     { path: ' ', pathMatch: 'full', redirectTo: 'all' }

];

3. const newItemRoutes: Routes = {

          path: 'add',

          loadchildren: () => ('./new-item/new-item.module').then(m => m.NewItemModule)

     },

     { path: ':medium', component: MediaItemListComponent },

     { path: ' ', pathMatch: 'full', redirectTo: 'all' };

4. const newItemRoutes: Routes = 

     { 

          path: 'add',

          children: () => export('./new-item/new-item.module').then(m => m.NewItemModule)

     },

     { path: ':medium', component: MediaItemListComponent },

     { path: ' ', pathMatch: 'full', redirectTo: 'all' };

 

1 Answer

0 votes
by

const newItemRoutes: Routes = [

     { 

          path: 'add',

          loadchildren: () => import('./new-item/new-item.module').then(m => m.NewItemModule)

     },

     { path: ':medium', component: MediaItemListComponent },

     { path: ' ', pathMatch: 'full', redirectTo: 'all' }

];

...