angular - 单个子路由的角度参数化路由
问题描述
我在 Angular 11 中使用路由:
{
path: '',
component: LandingpageComponent,
pathMatch: 'full'
},
{
path: 'upload',
component: TemplateLeftPanelComponent,
children: [
{
path: 'company/:companyId',
loadChildren: () => import('./modules/upload/upload.module').then(m => m.UploadModule),
outlet: 'content'
},
{
path: '',
loadChildren: () => import('./modules/upload/upload-panel/upload-panel.module').then(m => m.UploadPanelModule),
outlet: 'panel'
},
]
},
{
path: '**',
redirectTo: '/'
},
我想要它做什么:
- 网址:
/upload/
应该- 装入
/upload-panel.module
插座panel
- 将出口
content
留空
- 装入
- 网址:
/upload/company/123
应该- 装入
/upload-panel.module
插座panel
- 装入
/upload.module
插座content
- 装入
它能做什么:
- 网址:
/upload/
确实- 将出口
panel
留空 - 将出口
content
留空
- 将出口
- 网址:
/upload/company/123
确实- 重定向到
/
- 重定向到
解决方案
推荐阅读
- amazon-web-services - 了解 AppSync + S3 如何协同工作
- move - 将 OctoberCMS 网站从 Ubuntu 虚拟机移动到 CentOS 7 虚拟机
- hashicorp-vault - Hashicorp Vault 社区版文件系统后端的加密细节
- c++ - 在 C++ 中交换输出引用参数和局部变量的风险
- uwp - UWP:无法从代码隐藏访问菜单复选框
- processing - 从Processingjs草图保存PNG?
- bitbucket - 已超出此资源的速率限制
- module - ImportError:没有名为 jupyter_core.command 的模块,添加的路径没有问题仍然存在
- c# - 如何使用 JavaScript / AJAX 将对象插入 HTML 表
- javascript - 在 javascript 中向 Array.prototype 添加新方法