Complete the code to lazy load the AdminModule in Angular routing.
const routes: Routes = [
{ path: 'admin', loadChildren: () => import('./admin/admin.module').[1] }
];catch instead of then causes errors.load which is not a function.Use then(m => m.AdminModule) to load the module after import.
Complete the code to define a lazy loaded route for the UserModule.
const routes: Routes = [
{ path: 'user', loadChildren: () => import('./user/user.module').[1] }
];loadUserModule() which is not valid here.catch instead of then.The then method accesses the exported module after dynamic import.
Fix the error in the lazy loading syntax for the SettingsModule.
const routes: Routes = [
{ path: 'settings', loadChildren: () => import('./settings/settings.module').[1] }
];Module names are case sensitive and usually PascalCase, so SettingsModule is correct.
Fill both blanks to correctly lazy load the ReportsModule with a path 'reports'.
const routes: Routes = [
{ path: '[1]', loadChildren: () => import('./reports/reports.module').[2] }
];The path should be 'reports' and the module name ReportsModule with correct casing.
Fill all three blanks to lazy load the DashboardModule with path 'dashboard' and enable preloading strategy.
import { RouterModule, Routes, [1] } from '@angular/router'; const routes: Routes = [ { path: '[2]', loadChildren: () => import('./dashboard/dashboard.module').[3] } ]; @NgModule({ imports: [RouterModule.forRoot(routes, { preloadingStrategy: [1] })], exports: [RouterModule] }) export class AppRoutingModule {}
Use PreloadAllModules to preload lazy modules, path is 'dashboard', and module name is DashboardModule.