【发布时间】:2015-03-18 08:02:39
【问题描述】:
在我的 AngularJS 项目中,我尝试使用 Restangular getList 方法,但它返回错误,因为 API 响应不是直接的数组而是包含数组的对象。
{
"body": [
// array elements here
],
"paging": null,
"error": null
}
Restangular 错误消息是:
Error: Response for getList SHOULD be an array and not an object or something else
是否可以告诉 Restangular 它正在寻找的数组在 body 属性内?
【问题讨论】:
标签: angularjs restangular