how to fix Expected response to contain an array but got an object ANgular js

前端 未结 5 2277
再見小時候
再見小時候 2021-02-19 21:29

i am new one so difficult to getting this error using resource module after calling service. can any one modify my mistake in code where i am getting wrong or just modified that

5条回答
  •  孤城傲影
    2021-02-19 22:14

    A very simple solve for me from the documentation:

    app.factory('Article', ['$resource', function ($resource) {
        return $resource('/v1/a/:id', null,
            {
                'query':  {method:'GET', isArray:false},
                'update': { method:'PUT' }
            });
    }]);
    

提交回复
热议问题