【发布时间】:2016-12-02 09:48:49
【问题描述】:
我有以下代码,在 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 中放置断点(我的意思是在我的 MVC 控制器中的 Visual Studio 下)时,我看不到 Microsoft Edge 触发了 get 调用。
这是 Chrome 中网络检查器的外观:
这个来自 Edge:
据我了解,Edge 只对我的 GET 进行了一次真正的 XHR 调用,而所有其余的都只是从内存中缓存?
如何解决这个问题?为什么会发生这种情况?
【问题讨论】:
标签: angularjs debugging xmlhttprequest asp.net-core-mvc microsoft-edge