Angular2 中的深层链接
Deep Linking in Angular2
我是 Angular2 的新手。有没有一种方法可以在 Angular2 中进行深层链接来表达...类似这样的内容 http://may-app.com/projects/1/files/2?
我可以使用此代码在 Angular2 中使用提供的路由和路由参数http://my-app.com/projects/1
onClick(project){
this.router.navigate(['/projects', project.id ]);
}
谢谢!
可以通过添加路由器children来实现。
{ path: 'product/:id', component: ProductDetails,
children: [
{ path: 'file/:fileid', component: Overview }
]
}
要阅读有关深度链接的更多信息,我建议阅读这篇文章
https://angular-2-training-book.rangle.io/handout/routing/child_routes.html
我是 Angular2 的新手。有没有一种方法可以在 Angular2 中进行深层链接来表达...类似这样的内容 http://may-app.com/projects/1/files/2?
我可以使用此代码在 Angular2 中使用提供的路由和路由参数http://my-app.com/projects/1
onClick(project){
this.router.navigate(['/projects', project.id ]);
}
谢谢!
可以通过添加路由器children来实现。
{ path: 'product/:id', component: ProductDetails,
children: [
{ path: 'file/:fileid', component: Overview }
]
}
要阅读有关深度链接的更多信息,我建议阅读这篇文章
https://angular-2-training-book.rangle.io/handout/routing/child_routes.html