javascript - AngularJS 1.2 和 IE9 带有页面标题的奇怪行为

标签 javascript angularjs internet-explorer internet-explorer-9

在我的 Angular 应用程序中,我有一个静态页面标题:

<title>Title</title>

当我使用 $location.path('/home') 更改 View 时出现问题. IE 附加字符串 $/home到我的页面标题,像这样:

Title#/home#/home

过了一会儿,标题字符串变得很长,IE 显示错误,我不得不刷新页面。当我通过单击 <a href='#/home'> 更改 View 时链接,页面标题不变。

使用 $location.path() 时如何防止这种情况发生? ?

最佳答案

我已经在 Plunker 中试过了,效果很好。在这里:

http://plnkr.co/edit/pObS5qM0gd2Cr5iKnk8f

请注意 $location.path('/home') 可以在没有“/”的情况下调用。

$location.path('home')

关于javascript - AngularJS 1.2 和 IE9 带有页面标题的奇怪行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21778818/

相关文章:

javascript - AngularJS:如何获取 $http 结果作为函数的返回值?

php - Internet Explorer z-index 不适用于打开的 Flash 图表

javascript - jQuery 特效组合

javascript - 将表单数据存储在数组中?

javascript - AngularJS UI 路由器 : ui-sref and directive

javascript - 计算angularjs中选中复选框的数量

java - ntlm认证失败后IE7表单认证

javascript - 为什么我不能在 ie 中未插入的节点上使用原型(prototype) DOM 方法?

javascript - 禁用 div 内的元素

javascript - 如何以编程方式更改 dojo/dijit 选项卡标题?