all my rest API for the query (e.g. /clubs) return an object that is of this form:
{
"total": 10,
"results": [...]
}
the $resourece.query expect an array.
what's the correct way to parse this response?
- Should I override in the definition of the resource the query setting
isArray: false? (if I set the functions to override thequerydo I've to re-set all the other methods such asgetsaveetc?) - Should I create a parseFunction to parse the result and return an array? if so, how?
- how can I create a my resource in a way that I don't have to replicate the code for every resource? basically extending the current
$resourceobject to override the configuration, or the parsing function.