【发布时间】:2016-04-28 12:21:19
【问题描述】:
我正在尝试让 html5mode,角度 ui 路由在 IE9 中工作
if (window.history && window.history.pushState) {
$locationProvider.html5Mode(true);
} else {
console.log('IE9');
window.location.hash = '/'; // IE 9 FIX
$locationProvider.html5Mode(true);
}
$urlRouterProvider.otherwise("/");
$stateProvider
.state('placeholder', {
url: "/path/:myId",
templateUrl: '../path.html
controller: 'ResultCtrl'
}
);
我仍然得到 index/#/index/myid 而不是 index/path/myid,因为浏览器会忽略哈希标记及其之后的所有内容,所以它会带我进入索引。 (适用于 firefox、chrome、edge、IE11-10(支持 html5mode / api 历史的浏览器))
【问题讨论】:
-
您是否指定了应用程序的基本网址?
-
@MaKCbIMKo 是的,我的头部有基本网址。
-
@DrColossos 不是真的,我被重定向到主题标签之前的任何内容,而不是空白页面。
标签: angularjs internet-explorer angular-ui-router angular-routing