How do i get the get JSON data out of a $resource?
Currently all return values out of User.query
and User.$save()
are factory objects. I would like to be able to keep $scope.users
as raw JSON so I can modify it and post the data to another URL.
myApp.factory("User", function($resource) {
return $resource("/api/users/:Id", { Id: "@Id"}, {
"update": {method:"PUT"},
"query": { method:"GET", isArray: true }
});
});
var users = User.query(function() {
$scope.users = users;
});