ここで問題があります。サーバーへの http リクエストの一部をモックし、それらの一部を通過させようとしています! passThrougth() を呼び出すと、エラーがスローされます。
Error: Unexpected request: GET view/networks.html
No more request expected
at Error (<anonymous>)
at $httpBackend (http://localhost:8080/js/lib/angular-mocks.js:887:9)
at $httpBackend (http://localhost:8080/js/lib/angular-mocks.js:880:11)
at sendReq (http://localhost:8080/js/lib/angular-scenario.js:18264:9)
at $http (http://localhost:8080/js/lib/angular-scenario.js:18055:17)
at Function.$get.$http.(anonymous function) [as get] (http://localhost:8080/js/lib/angular-scenario.js:18198:18)
at $get.$q.when.then.then.next.locals (http://localhost:8080/js/lib/angular-scenario.js:16605:34)
at deferred.promise.then.wrappedCallback (http://localhost:8080/js/lib/angular-scenario.js:16028:59)
at deferred.promise.then.wrappedCallback (http://localhost:8080/js/lib/angular-scenario.js:16028:59)
at ref.then (http://localhost:8080/js/lib/angular-scenario.js:16065:26)
これが私の走りです
myAppDev.run(function ($httpBackend) {
$httpBackend.whenGET("view/networks.html").passThrough();
$httpBackend.whenGET('/r/networkInterface').respond(networkInterfaces);
});
私の設定の問題は何ですか?
とにかく、 response(" with some response ") を呼び出すと、正しい結果が得られます。つまり、$httpBackEnd は、応答に入れられたものを返します。