feat($resource): pass isArray to http config
This will allow to indentify request type in global interceptor.
I need to identify if request is array or object and put necessary array or object to httpCache accordingly if request does not need to be made.
I don't get the usecase (and I suspect this might not be something commonly useful to include in core). Could you provide more details on why you need this/how you will use this ? (An example maybe ?)
You are right, this is not a common usecase. But, why drop isArray param? I would expect all data that I enter in resource configuration to be found in http config object. I can find cache, method, header and transformer params, so why no isArray?
Hm...good point. As a work-around, you can pass your custom param (but you must be in charge of all $resources and it's less than ideal). E.g.:
var Thing = $resource('/api/thing/:id', {id: '@id'}, {
query: {method: 'GET', isArray: true, itsAnArray: true}
});
// ...then look for `config.itsAnArray` in your interceptor
Regarding the question "why not to include isArray":
I guess it was skipped in the first place, because it is a $resource-specific property and doesn't have any usefulness for $http.
On the other hand, it is (kind of) related to/characterizing the request.
I could definitely leave with passing isArray to $http.
So, it LGTM after all.
Let's see what other people have to say.
Thanks, I will implement temporary workaround and will wait for what you decide