We have this service using ng-resource:
var app = angular.module('salonesbelleza', []);
app.service("CentroBorrar_srv", function ($resource, UrlBaseApi_srv) {
return{
return $resource('wa-centros/:id',
{id:'@id', access_token:'@access_token'},
{ "post": { method: "DELETE",
isArray: false,
headers: {
'Accept': 'application/json; q=1.0, */*; q=0.1',
'Content-Type':'application/json'
}
}}
);
}
});
In the controller We use this way
var CentroBorrar_data = CentroBorrar_srv.post({
id:10,
othervar1:'VALUE_1',
othervar1:'VALUE_2',
access_token:'MY TOKEN'
});
With this ng-resource We delete an element with id=10 using some extra vars like acces_token
This work very well. And this is the URL generated by this ng-resource
wa-centros/10?access_token=MY_TOKEN&othervar1=VALUE_1&othervar2=VALUE_2
All vars are sent using GET in the URL But We want to send some vars using POST and others using GET. For example, We want to send othervar1 and othervar2 using POST.
Is there a way We can force in the ng-resource definition which var in the controller must be sent by POST and which must be sent using GET
I feel lost on this subject
Thank you very much in advance