Restangular and nested responses

Posted: 2014-06-21 18:33:42

this was key to dealing with this type of results

{
 "data": {
    "name": "Foo"
  },
 "message": {
   "Post Updated"
 }
}

So I had to set this in a app.js config area

//app,js
app.config(function(RestangularProvider) {

    // add a response intereceptor
    RestangularProvider.addResponseInterceptor(function(data, operation, what, url, response, deferred) {
        var extractedData;
        extractedData = data.data;
        return extractedData;
    });

});