How can i pass query params as arguments in angularjs http services. My controller code is:
FetchHeadCategoryService.get({
'officeJndi': officeJndi
}, function (response) {
$scope.headCategories = response;
});
Service.js
module.factory('FetchHeadCategoryService', [
'$resource',
'SYSTEM',
function($resource, SYSTEM) {
return $resource(SYSTEM.ENV.API_END_POINT
+ 'v1/utility/headCategories/:officeJndi ', {
officeJndi : '@officeJndi'
}, {
get : {
method : 'GET',
isArray : true
}
});
} ]);
HeadCategory.java
public Response fetchDocMgmtHeadCategory(@PathParam(value = "officeJndi") final String officeJndi, @QueryParam(value = "limitFrom") final int limitFrom,@QueryParam(value = "noOfRows") final int noOfRows){
..
..
..
}
I can obtain the result without passing the query params by managing them in the code. But I want to send the value of query params "limitFrom" and "NoOfRows" to the service ,so that i acn fetch the data accordingly.Can somebody HELP.