I have configured my application with Spring MVC for backend and AngularJS for frontend. I am encountering an issue with ngresource while making http calls. The response data is not being retrieved properly.
test.js
angular.module('app').factory("testService",
function($resource) {
return {
getdata: $resource('/setupdata',{},
{
'save' : {
method:'POST'
}
}) };
});
angular.module('app').controller('testController',function($scope, $http,testService) {
var init = function(){
testService.getdata.get(function(response) {
//in response age,height etc is there
//if I put alert I am getting[Object,Object] and If I put JSON.stringify(data) all the parameters are appearing like age , height etc,If I check with data.age, data.height a blank braces is coming {}.
}
init();
});
The data passed from my Spring MVC is not being received as expected.