I have a model, defined using $resource, that I am successfully loading.
Each loaded instance is, as promised, an instance of the class I defined.
transformResponse does the job. Consider example (I wanted to use Autolinker to format response content).
return $resource('posts/:postId', {
postId: '@_id'
}, {
get : {
transformResponse : function(data) {
var response = angular.fromJson( data );
response.content = Autolinker.link(response.content);
return response;
}
},
update: {
method: 'PUT'
} });