Server response to a data array in JSON format:
["2345","1234"]
Angular service module defines:
angular.module('MySource', ['ngResource']).factory('Phone', function($resource){ return $resource('/api/source'); });
Then I use Phone.query(); to retrieve the array data, but got the following:
[{"0":"2","1":"3","2":"4","3":"5"},{"0":"1","1":"2","2":"3","3":"4"}]
But $http works:
$http.get('/inner/source').success(function(data){
What is the problem? Why is $resource sharing an array? Am I using $resource wrong way?
Thanks.
source share