在我的 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/