Seems like your Angular version is 11.
The lazy loading syntax changed. It is something like this now
const routes: Routes = [
{
path: 'items',
loadChildren: () => import('./items/items.module').then(m => m.ItemsModule)
}
];
So your code should be like this
const routes: Routes = [
{ path: "", redirectTo: "/books", pathMatch: "full" },
{
path: "books",
loadChildren: () => import('./modules/book/book.module').then(m => m.BookModule),
canActivate: [AuthGuard]
},
{ path: "login", component: LoginComponent }
];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…