我有以下路由配置。如何从项目编辑组件内部访问父路由中看到的:projectId ?
{
path: 'folders/:folderId/projects/:projectId/s',
component: ProjectDetailComponent,
canActivate: [AuthGuardService],
children: [
{
path: 'edit',
component: ProjectEditComponent,
canActivate: [AuthGuardService],
},
{
path: 'i',
component: IssuesListComponent,
canActivate: [AuthGuardService],
},
],
},
当我没有子路线时,我以前使用过这种方法:
this.activatedRoute.params.subscribe((urlParameters) => {
this.project_id = urlParameters['projectId'];
});
不幸的是,这不再有效。