angularjs $resource.query with complex structure -


all rest api query (e.g. /clubs) return object of form:

{ "total": 10, "results": [...] } 

the $resourece.query expect array.

what's correct way parse response?

  • should override in definition of resource query setting isarray: false? (if set functions override query i've re-set other methods such get save etc?)
  • should create parsefunction parse result , return array? if so, how?
  • how can create resource in way don't have replicate code every resource? extending current $resource object override configuration, or parsing function.

what receiving object , not array, use $resource.get, can access results array object


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -