ビクラムは、ブラウザではなかったことは正しかったしながら、タイムアウト、パラメータを使用します。それはAngularであった。私は角を知らないので、私はハックする必要があります。私はあなたにハックを見せますが、それを使用しません。より良い解決策を見つけるためのヒントとして考えてみましょう。また、以下のコードを変更する必要はありません。
angular.module('MyApp', [])
.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.timeout = 5000;
}]);
それに加えて、私の浮浪者のマシンにこのプロキシがタイムアウト引き起こした: https://github.com/drewzboto/grunt-connect-proxy
ウェブの着信を
は
function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {
// TODO(vojta): fix the signature
return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {
// DO NOT COMMIT :) (added line)
timeout = 5000001; // added line
$browser.$$incOutstandingRequestCount();
url = url || $browser.url();
....
function timeoutRequest() {
jsonpDone && jsonpDone();
xhr;// && xhr.abort();
}
app.jsをangular.js。 js
function timeout(req, res, options) {
// DO NOT COMMIT
req.socket.setTimeout(600000);
//if(options.timeout) {
// req.socket.setTimeout(options.timeout);
//}
}、