Angular 如何在角路由器的静态URL之间添加参数?
我想配置一个类似“name1/:id/name2”的路径并导航到它。如何做到这一点 使用路由器配置Angular 如何在角路由器的静态URL之间添加参数?,angular,angular-router,Angular,Angular Router,我想配置一个类似“name1/:id/name2”的路径并导航到它。如何做到这一点 使用路由器配置 routes = [ {path: 'name1/:id/name2', component: SomeComponent} ] 并通过this.router.navigate(['name1',id,'name2'])或使用元素导航到它 链接使用路由器配置 routes = [ {path: 'name1/:id/name2', component: SomeComponent} ] 并
routes = [
{path: 'name1/:id/name2', component: SomeComponent}
]
并通过this.router.navigate(['name1',id,'name2'])或使用元素导航到它
链接
使用路由器配置
routes = [
{path: 'name1/:id/name2', component: SomeComponent}
]
并通过this.router.navigate(['name1',id,'name2'])或使用元素导航到它
链接