Ok, so I think I'm missing something basic here but I couldn't figure it out reading the docs and other examples. I have a resource in a factory like this:
loteManager.factory('Lotes', function($resource) {
return $resource('./api/lotes/:id',{ id:"@id" }, {
get: {method:'GET', isArray:true}
});
});
And my controller:
loteManager.controller('LoteCtrl',
function InfoCtrl($scope, $routeParams, Lotes) {
Lotes.get(function (response){
console.log(response);
});
});
It works when I define the id manually like this $resource('./api/lotes/21' so I think the problem is passing the id to the factory but I already tried adding params:{id:"@id"} but that didn't work either.