【发布时间】:2017-10-20 07:07:45
【问题描述】:
我有以下网址:localhost.com:1234/?param1=abc&param2=def
Route.config = [
{ path: 'first', component: 'firstComponent' },
{ path: 'second', component: 'secondComponent' }
]
当应用初始化时,URL 被替换为 localhost.com:1234/#/first。
如何防止这种情况,以便我的重定向 url 将是 localhost.com:1234/?param1=abc&param2=def#/first?
【问题讨论】:
-
通过在我的 index.html 页面中添加 window.history.pushState=null 解决了问题
标签: angular2-routing