0
我在這裏有一些問題。我試圖嘲笑我的一些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);
});
什麼是我的配置問題?
任何方式,當我呼籲迴應(「有一些迴應」),我得到的結果是正確的。即$ httpBackEnd返回什麼是作出迴應!