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
I had similar problem and non of the answers quite worked for me, heres what i did:
$resource("/", {}, {
query: {
method: 'GET',
isArray: false,
transformResponse: function (data, headers) {
//if no data return so no warnings
if (data == ''){
return;
}
return {data: $.extend({}, eval("{" + data + '}'))};
}
}
});
Uses jquery. Basically convert array to object so angularjs resource doesn't poop its pants.