javascript - ngActiveResource all() with nested REST response -


i using ngactiveresource models , interacting rest api. (i'm impressed it)

it working single models server response (show) "flat" eg:

{     "pk": 42692 } 

however 'index'/list responses data nested eg:

{     "num_results": 1,      "objects": [         {             "pk": 42692         }     ],      "page": 1,      "total_pages": 1 } 

this results in ngactiveresource creating 4 models of empty. assume 1 each attribute ("num_results", "objects", "page", "total_pages") , empty data contain not line model definition.

how go telling ngactiveresource data nested? there way intercept request? know built upon angular's $resource must possible.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -