angular2 是否支持嵌套状态/路由? 例如,在一个 View 端口中有 2 个链接,在单击特定链接时,它将显示一个 View ,该 View 还具有多个链接,但特定于较早的链接。
最佳答案
有了新版本的路由器,如果你想使用嵌套路由, 这是一个关于如何定义路径的例子
{
path: 'search',
component: SearchComponent,
children: [
{ path: 'results/:id', component: ResultsComponent },
]
}
在您的搜索组件模板中,添加 <router-outlet></router-outlet>
关于routes - angular2 是否支持嵌套状态/路由?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34978616/