Using AngularJS 1.2.16 and angular-resource 1.2.16.
I have a resource like:
$resource('api/:variable/path',
{
variable:'@variableName'
});
When I do a get using something like
resourceIns.get({variable:'taco'});
The resulting ajax call replaces :variable properly and i get
api/taco/path
If I do a post like
resourceIns.save({variable:'taco'});
the resulting ajax call looks like
api/path
and 'taco' gets put in the POST body...
I've had trouble finding others complaining about this so, maybe this is what's supposed to happen?
edit: I just discovered that get uses 'variable' and save/POST uses 'variableName' in the above example. Anybody have an explanation for that?
Here's a fiddle showing the situation: fiddle
I ran across the same issue or one that presented itself in the same fashion. My resource, too, was not respecting parameters passed in through a .post method.
I was able to get it to work by directly passing in the expected parameters.
Using a $resource: