I am trying to learn angularjs, and have hit a block in trying to databind to an array returned from a Rest API. I have a simple azure api returning an array of person objec
Just wanted to cross-post my adaptation of a solution Aleksander gave on another stackoverflow question: https://stackoverflow.com/a/16387288/626810:
methodName: {method:'GET', url: "/some/location/returning/array", transformResponse: function (data) {return {list: angular.fromJson(data)} }}
So when I call this function:
var tempData = ResourceName.methodName(function(){
console.log(tempData.list); // list will be the array in the expected format
});
Obviously this a little bulky if you need to GET arrays in multiple methods / resources, but it seems to work.