I'm trying to pass the folder name inside my query function.
In my controller, I have:
$scope.people = getResult.query({api: 'person'});
And in my services, I have, so far:
.factory('getResult', function($resource) {
var getResult = $resource('api/:path/:method/:id', {}, {
query: {method:'GET', params: {path:'@api', method:'get'}, isArray:true },
save: {method:'POST', params: {method:'save'} },
get: {method:'GET', params: {method:'edit'} },
remove: {method:'DELETE', params: {method:'remove'} }
});
return getResult;
});
The URL I'm getting is http://localhost/project/api/get?api=person but what I need is http://localhost/coral/api/person/get
I'm a newbie to Angular. What is the right way to do this, and why this is happening?