我在路由延迟加载模块的子模块时遇到问题,它在单击链接时重定向,但在刷新时显示 abc/runtime.js
它重定向但在刷新时会出现此错误
GET http://localhost:4200/research-institutes/runtime.js net::ERR_ABORTED 404 (Not Found)
应用模块路由
path:'',
component:DefaultComponent,
children: [
{
path:'research-institutes',
loadChildren:'../../src/app/views/research-institutes/research-institutes.module#ResearchInstitutesModule'
}
]
延迟加载模块路由
const routes: Routes = [
{
path:'',
component:InstitutesListingComponent
},
{
path:'detail',
component:InstituteDetailComponent
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})