是否可以通过多个路由参数,例如如下所示,需要将id1和id2传递给组件B
@RouteConfig([ {path: '/component/:id :id2',name: 'MyCompB',component:MyCompB } ]) export class MyCompA { onClick(){ this._router.navigate( ['MyCompB',{id: "someId",id2: "another ID"}]); } }
OK实现了一个错误..它必须是/:id /:id2
原文链接:https://www.f2er.com/angularjs/142586.html反正没有在任何教程或其他StackOverflow问题中找到这个.
@RouteConfig([{path: '/component/:id/:id2',component:MyCompB}]) export class MyCompA { onClick(){ this._router.navigate( ['MyCompB',id2: "another ID"}]); } }