Angular 当路径有多个段时,延迟加载的角度获取ChunkLoadError错误
我当前在尝试删除时遇到以下错误 ChunkLoadError:加载chunk仪表板模块失败 我有以下两个模块:Angular 当路径有多个段时,延迟加载的角度获取ChunkLoadError错误,angular,routes,Angular,Routes,我当前在尝试删除时遇到以下错误 ChunkLoadError:加载chunk仪表板模块失败 我有以下两个模块: const routes: Routes = [{ path: 'test', component: TestProductComponent }]; 仪表板模块 产品模块 下面是我的app.routing.ts const routes: Routes = [ { path: 'product', loadChildren: () => import('./product/p
const routes: Routes = [{ path: 'test', component: TestProductComponent }];
const routes: Routes = [
{ path: 'product', loadChildren: () => import('./product/product.module').then(m => m.ProductModule),
canActivate: [LoggedInGuard] },
{ path: 'dashboard', loadChildren: () => import('./dashboard/dashboard.module').then(m =>
m.DashboardModule) }
];
我的产品模块有自己的路径,如下所示:
const routes: Routes = [{ path: 'test', component: TestProductComponent }];
如果单击routerlink所在的产品导航:product/test,它将正确加载testproduct组件
注意:上面的url是:localhost:4200/product/test
但是,如果我尝试导航回仪表板,其路径为:
localhost:4200/产品/dashboard,而不是localhost:4200/dashboard
我是否遗漏了上面的任何内容?我如何修复此问题?您如何返回?如果有后退按钮,则routerLink的使用可能缺少反斜杠
<a [routerLink]="['dashboard']">Back</a> // localhost:4200/product/dashboard
<a [routerLink]="['/dashboard']">Back</a> // localhost:4200/dashboard
Back//localhost:4200/产品/仪表板
后退//本地主机:4200/仪表板
我有一个与上面显示的一样的导航,但仍然不起作用。