2
我已经以下ngResource定义:无效结果
angular.module('LicenseServices', ['ngResource']).
factory('License', function ($resource) {
return $resource('api/licenses/:id', { id: '@id' }, {
//...
'getLicenseTypes': { method: 'GET', url: 'api/licenses/types', isArray: true }
});
});
GET请求的结果是:
["Trial","Standard"]
但是,在一个控制器使用该资源:
$scope.licenseTypes = License.getLicenseTypes()
我收到以下结果:
licenseTypes:
[ undefined, {
0: S
1: t
2: a
3: n
4: d
5: a
6: r
7: d
} ]
我在Chrome上使用AngularJS 1.1.4。
我的资源定义有什么问题?
重复的:http://stackoverflow.com/questions/13813673/one-dimensional-array-of-strings-being-parsed-to-2d-by-angular-resource?rq=1 – Intelekshual 2013-05-02 17:18:57