Angular2 - two components with the same route

前端 未结 1 1696
旧时难觅i
旧时难觅i 2020-12-10 06:00

In angularJS ui-router allows us to use 2 components with the same route using states (like in this example Angular UI Router: Different states with same URL?).

Is i

相关标签:
1条回答
  • 2020-12-10 06:39

    You can have routes with parameters like

    /article/:id/detail

    Where /article/123/detail and /article/abc/detail lead to the same component.

    See for example this tutorial https://angular.io/docs/ts/latest/tutorial/toh-pt5.html (Search for "Configure a Route with a Parameter")

    0 讨论(0)
提交回复
热议问题