Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java angularJs isArray:错还是真_Java_Javascript_Angularjs_Rest_Spring Mvc - Fatal编程技术网

Java angularJs isArray:错还是真

Java angularJs isArray:错还是真,java,javascript,angularjs,rest,spring-mvc,Java,Javascript,Angularjs,Rest,Spring Mvc,我试图通过SpringREST和AngularJS从数据库中获取数据,但我得到了这个结果 错误:何时生成isArray:true "Error: [$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object 当试图通过make来解决这个错误时 'query': { method: 'GET', isArray: false} 我得到这

我试图通过SpringREST和AngularJS从数据库中获取数据,但我得到了这个结果 错误:何时生成isArray:true

"Error: [$resource:badcfg] Error in resource configuration. Expected
  response to contain an array but got an object
当试图通过make来解决这个错误时

 'query': { method: 'GET', isArray: false}
我得到这个错误

[$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.2.26/$rootScope/inprog?p0=%24digest
这是我的密码

@RequestMapping(value = "/rest/assets",
        method = RequestMethod.GET,
        produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public List<Asset> getAll() {
    log.debug("REST request to get all Assets");
    List<Asset> assets=assetService.getAllOrderByIdDesc();
    return assetService.getAllOrderByIdDesc();
}
service.js

adapApp.factory('Asset', function ($resource) {
    return $resource('app/rest/assets/:id', {}, {
        'query': { method: 'GET', isArray: false},
        'get': { method: 'GET'}
    });
 });
控制器

adapApp.controller('AssetController', function ($scope, resolvedAsset
      , Asset ) {
$scope.assets = resolvedAsset;
});
html页面

<tr ng-repeat="asset in assets">
                    <td>{{asset.id}}</td>
                    <td>{{asset.assetName}}</td>
                    <td>{{asset.locations[0]}}</td>
                    <td>{{asset.airport.iatacode}}</td>
                    <td>{{asset.lastupdateUserid}}</td>
                    <td>{{asset.lastupdateDateTime}}</td>
                    <td>{{asset.domainName}}</td>
                    <td>
 <tr>

{{asset.id}
{{asset.assetName}
{{asset.locations[0]}
{{asset.airport.iatacode}
{{asset.lastupdateUserid}
{{asset.lastupdateDateTime}
{{asset.domainName}

我认为
query
get
都默认为
isArray:false
,因此您当前没有具有
isArray:true的方法
我在rout.js not get method中使用query方法我似乎对上述代码没有问题。如果错误是关于“$digest”,那么在代码中是否使用类似“$digest.$apply”的内容?
<tr ng-repeat="asset in assets">
                    <td>{{asset.id}}</td>
                    <td>{{asset.assetName}}</td>
                    <td>{{asset.locations[0]}}</td>
                    <td>{{asset.airport.iatacode}}</td>
                    <td>{{asset.lastupdateUserid}}</td>
                    <td>{{asset.lastupdateDateTime}}</td>
                    <td>{{asset.domainName}}</td>
                    <td>
 <tr>