I am trying to fetch data using query action method from a restful service using Angular $resource
When I use the default query method as MyService.query();
I have received the following error:
[$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object
Now, when overload the query action as follows error disappears which is expected.
'query': {method:'GET',IsArray:true}
But the issue is if I set IsArray to false, still there is no error. Why? I should have received the same error as in former case.
What am I missing here please?
query
expects array of objects. It doesn't make sense to feed it with just an object unless you create your custom resource logic.isArray
is used more for verbs likePUT
to specify the response format.