繁体   English   中英

Angular 2路由在IE9中添加了锚点

[英]Angular 2 routing adds anchor in IE9

我有这个路由器:

...
import { Router, Routes, RouterModule } from '@angular/router';
...

const routes:Routes = [
    { path:'', redirectTo:'home', pathMatch:'full'},
    { path:'home', component: HomeComponent},
    ...
]

我使用

router.navigateByUrl('/home');

在IE9以外的所有浏览器中,它都可以正常工作。

它添加到当前的URL#,所以如果我浏览到localhost ,它呈现HomeComponent确定,但该网址是localhost/#/home如果我手动添加localhost/home它关系到localhost/home/#/home和失败

在GitHub问题上找不到任何内容(一些类似的问题,但不相同),我无法自己找到问题。 有什么线索吗?

Internet Explorer 9不支持HTML5 推送状态导航。 Angular2默认为IE9上的哈希导航

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM