【发布时间】:2019-09-26 07:56:02
【问题描述】:
我在角度路由中有两个 url 定义。
http://localhost:4200/user/:id/:mode -> 组件 1 和 http://localhost:4200/user/:id/preview -> 组件2
如果我调用http://localhost:4200/user/1/edit 或http://localhost:4200/user/1/view,它将使用给定的 id 和给定的模式参数打开 component1。到目前为止还不错。
但是如果我打电话给http://localhost:4200/user/1/preview 我想去component2。 但是路由模块使用“预览”模式将我路由到组件 1。
那么有什么建议可以解决这种路由冲突吗?
br
【问题讨论】:
-
可以分享一下你的路由文件的内容吗