In the controller,
$scope.save = function(obj) {
restService.save(
{table: "relations", id: obj.id}, obj
)
}
In the service,
.service('restService', ['$resource', function($resource){
var prefixUrl = "http://localhost:4507/v1/rest";
{
table: "@table",
id: "@id"
},
{
query: {
method: "GET",
},
save: {
method: "PUT",
},
delete: {
method: "DELETE",
}
}
);
}])
When I call save, with integer value changed within obj, it's automatically converted to string.
You can see news_count: 0 in the first picture, but when I change it's value to 120 and make a request again, $resource seems to change it to "120" instead of 120.
Why is this happening?

