【发布时间】:2016-11-16 09:42:00
【问题描述】:
我目前正在尝试导航到具有不同 id 值的同一页面。因此,如果我在/test/1 上并转到/test/2,浏览器中的 url 会更新,但视图不会刷新。我调试了 ngOnInit,导航到 /test/2 时它没有重新运行。但是,如果我从test/1 转到other,路由工作正常,只有在使用不同参数导航到同一路由时才会出现问题。有没有其他人遇到过这个?当我有时间生病时上传一个 plunkr。
Angular 2 rc3 路由器3.0.0-beta.2
RouterConfig = [
{
path: '',
component: 'Layout',
children: [
{
path: 'test/:id',
component: TestComponent
},
{
path: 'other',
component: OtherComponent
}
]
}
]
谢谢, LL
【问题讨论】: