2
我有以下代码,它在Mozilla,Chrome上运行得非常好,但在Microsoft Edge或Internet Explorer上运行得不错。这是发生了什么。
当用户加载网页我触发下面的代码:
$http.get("/api/items")
.then(function (response) {
angular.copy(response.data, $scope.items);
}, function (error) {
$scope.errorMessage = error.statusText;
})
.finally(function() {
$scope.isBusy = false;
});
其拉所有的值到<ul>
。这部分在所有浏览器上正常工作。但是,当我触发以下一个:
$scope.interval = $interval(function() {
$http.get("/api/items")
.then(function (response) {
//success
//loop through the response
angular.forEach(response.data, function (value, key) { ... more code here}
然后突然反应不再是从我的web api。我的意思是,当我调试我的应用程序并在我的GET api(我的意思是在Visual Studio中的MVC控制器下)中放置断点时,我无法看到Microsoft Edge触发的获取调用。
这里是什么样的网络检查员看起来像从Chrome中:
而这一次是从边缘:
据我了解,边有只发一个真正的XHR调用我的GET,剩下的只是从内存中缓存?
如何解决这个问题?为什么会发生这种情况?