All,
I'm having some trouble with $resource calls in my angularjs app. I've spent a couple of days looking for answers and from what I can see my code should work but it just doesn't. I would be truly grateful if anyone could explain to me what the problem is with the following code (which is executed in a controller).
var Comp = $resource('http://localhost:8081/my-rest-ws/webapi/company/:id', {id: '@id'});
$scope.company = Comp.get({id: 1}, function() {
console.log('got it');
});
When I inspect the URL in the dev console it looks as follows:
URL:http://localhost:8081/motrev-rest-ws/webapi/company/:id/[object%20Object]<br>
It was my understanding that the id parameter should be replaced by the value (1 in my case) but clearly that doesn't happen. So, what am I doing wrong?
Thanks in advance
Daniel Södling