我有一个方法:
$scope.$on('$locationChangeStart', function (event, next, current) {
//......
}
但是当我使用谷歌Chrome浏览器时,我有:
current = localhost:8080/index.html#/step1
next = localhost:8080/index.html#/step2
当我使用Internet Explorer时,我有:
current = localhost:8080/index.html#/step2
next = localhost:8080/index.html#/step1
如何配置AngularJS,而不是我在不同的浏览器中配置:
current = localhost:8080/index.html#/step1
next = localhost:8080/index.html#/step2
答案 0 :(得分:0)
newState和oldState参数只能在HTML5模式下定义,并且当浏览器支持HTML5 History API时。
遗憾的是,HTML5历史记录API only available for IE >= 10。
如果你不得不支持IE,我恐怕你必须找到另一种方式< 10 ...