Ajax GET 返回对象 #<Object> 没有方法"切片"错误



我进行了以下ajax调用,

$scope.clientList = [];
                     $http({
                     method: 'GET',
                     isArray: true,
                     url: "https://localhost/api/Client",
                     params: sort,
                 }).success(function (data, status, headers, config) {
                            $scope.clientList = data;
                     }). error(function (data, status, headers, config) {
                     });

我得到一个数组作为数据的结果。但是我得到了一个错误,

TypeError: Object #<Object> has no method 'slice'

尽管添加了isArray: true。

$scope.clientList = [];
                 $http({
                 method: 'GET',
                 isArray: true,
                 url: "https://localhost/api/Client",
                 params: sort,
             }).success(function (data, status, headers, config) {
                        $scope.clientList = data.data;
                 }). error(function (data, status, headers, config) {

Sorry是一个简单的转换问题。

指定对象而不是返回对象内部的数组。

最新更新