角度5:按父ID加载子组件

时间:2018-07-26 12:48:41

标签: angular-cli angular-routing

我有这个路由模块

...
{
  path: ':product-name/details',
  component: DetailsComponent
},
...

但是我需要根据产品名称加载不同的子组件

例如 如果产品名称是香蕉负载BananaComponent 如果产品名称为apple,则加载AppleComponent 等

如何获得它?

0 个答案:

没有答案