Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 对于大型API调用的角度http请求,hungs处于“阶段”;警告:请求尚未完成”;而且它会影响浏览器_Javascript_Angularjs_Api_Google Chrome_Http - Fatal编程技术网

Javascript 对于大型API调用的角度http请求,hungs处于“阶段”;警告:请求尚未完成”;而且它会影响浏览器

Javascript 对于大型API调用的角度http请求,hungs处于“阶段”;警告:请求尚未完成”;而且它会影响浏览器,javascript,angularjs,api,google-chrome,http,Javascript,Angularjs,Api,Google Chrome,Http,我请求一个API,它返回文件的差异。这些数据的内容有时是巨大的(大约900KB的数据)。 当我在chrome浏览器中单独请求此API时,它工作正常,并在几秒钟内返回数据: 但当我使用AngularHTTP方法调用同一个API时,它会处于“警告:请求尚未完成”状态(从chrome的网络选项卡中可以看到)。浏览器会变得无响应 myService.getFileDiff("https://example.com/1234/file.diff"). then(function (response)

我请求一个API,它返回文件的差异。这些数据的内容有时是巨大的(大约900KB的数据)。 当我在chrome浏览器中单独请求此API时,它工作正常,并在几秒钟内返回数据:

但当我使用AngularHTTP方法调用同一个API时,它会处于“警告:请求尚未完成”状态(从chrome的网络选项卡中可以看到)。浏览器会变得无响应

myService.getFileDiff("https://example.com/1234/file.diff").
 then(function (response) {
  $scope.fileDiff = response;
  }, function(error){
   console.log("Some error occured." +error);
});


任何人都可以提出解决方案。

嘿,你解决了吗。我在我的网站上也面临着类似的问题。