I have this call. I would like to manipulate the data returned by the REST service before the controller uses it. How can this be accomplished? Now I get the raw data. I understand that I can but this logic ApiFactory.get(function(data)); but I prefer to have the logic in the server. How can I do this?
In Service:
app.factory('ApiFactory', ['$resource', function($resource) {
return $resource('http://localhost:8080/rest/forum/categories/1');
}]);
In controller:
app.controller('SubjectCntrl', ['$scope', 'categoryService', 'ApiFactory', function($scope, categoryService, ApiFactory) {
ApiFactory.get(function(data) {
console.log(data);
});
}]);
$locationProvider's resolve.