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,剩下的只是從內存中緩存?
如何解決這個問題?爲什麼會發生這種情況?