I am using angularjs and spring rest service. its a very simple scenario but dont know whats the issue!
This is my controller where in it returns array of daya defined in service.js. In below code, console returns 0 always.
controller.js
$scope.allreviews = PostFactory.reviews.query({key: reviewId});
console.log('read more' + $scope.allreviews.length);
services.js
reviews: $resource('/ngdemo/web/posts/review/:key', {}, {
query: {method: 'GET', isArray: true, params: {key: '@key'} },
create: {method: 'POST'}
})
now, the rest service defined in reviews method"/ngdemo/web/posts/review/:key" returns data as I can see in Firefox console GET method. but it doesnt reach controller, hence cant access the data. Could you please help suggesting whats the issue?
I tried removing isArray: true but it throws error $destination.push is nt a function or something error.
Please suggest