Angular Hybrid - 如何访问子组件中的路径变量

问题描述

各位,

最近我们开始将旧版 AngularJS 应用升级到 Angular 8。在此过程中,我们在 Angular 8 应用中定义了各种路由。所有新路由都将转到 Angular 8,常规路由将重定向到 AngularJS。

我在 Angular 8、患者、机构等中很少有这样的组件。

我想根据路径中提供的 id 导航到子路由。例如,ng/患者/12345。它应该转到 patientComponent 并读取 12345,这也是组件的输入。我怎样才能做到这一点?我试着做一些搜索,也没有运气就跟着一些教程。任何运气将不胜感激。

我在 Angular 8 AppModule 中的路由

const nestedState: NgHybridStateDeclaration[] = [{
        url: '/new',name: 'new',component: AppComponent,},{
        url: '/insitutions',name: 'new.institutions',component: InsitutionComponent,{
        url: '/patients',name:'new.patients',component: PatientComponent
    }
];

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)