Error: [$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How fix Error: [$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object? // Service angular . module ( 'admin.services' , [ 'ngResource' ]) // GET TASK LIST ACTIVITY . factory ( 'getTaskService' , function ( $resource ) { return $resource ( '../rest/api.php?method=getTask&q=*' ,{ 'get' : { method : 'GET' }}); }) // Controller $scope . getTask = getTaskService . query ( function ( response ) { angular . forEach ( response , function ( item ) { if ( item . numFound > 0 ) { for ( var