【发布时间】:2020-11-26 11:05:21
【问题描述】:
您好,我需要为组件创建动态路径... 像这样的..
localhost:4200/category/category1/category2/category3/category4
这是解决这个问题的唯一方法吗?
{
path: 'category/:category1',
component: CategoryComponent,
},
{
path: 'category/:category1/:category2',
component: CategoryComponent,
},
{
path: 'category/:category1/:category2/:category3',
component: CategoryComponent,
},
{
path: 'category/:category1/:category2/:category3/:category4',
component: CategoryComponent,
},
或者我还有其他选择吗?
【问题讨论】:
标签: angular dynamic path routes