来自服务器的以下 JSON 响应
[
"hello",
"world"
]
此 ngResource 服务正在将其解析为二维数组
myService.factory('Name', function($resource){
return $resource(site_url+'api/accounts/:accountId/names/', {}, {
list: {method:'GET', params:{}, isArray:true}
});
});
像这样称呼
$scope.names = Name.list({accountId:$scope.account.id}, function(e){
console.log(e);
});
追溯到
[{"0":"h","1":"e","2":"l","3":"l","4":"o"},{"0":"w","1":"o","2":"r","3":"l","4":"d"}]
有什么提示吗?