Why do I receive error … unexpected request: GET /internalapi/quotes

前端 未结 2 1197
Happy的楠姐
Happy的楠姐 2020-12-02 21:47

I\'ve defined the following service in my angular app :

services.factory(\'MyService\', [\'Restangular\', function (Restangular) {
       return {
                   


        
2条回答
  •  借酒劲吻你
    2020-12-02 22:37

    I had the same problem as you guys. My solution was to add a '/' at the start of the URL-parameter of the .expectGET. Using your example:

    $httpBackend.expectGET("/internalapi/quotes").respond({ hello: 'world'})
    

    Best of luck

提交回复
热议问题