【发布时间】:2019-08-22 10:03:07
【问题描述】:
我正在使用 Angular 8.2.0 和 ngx-restangular。在我的服务中,我使用getList();控制台中出现以下错误
Error: Response for getList SHOULD be an array and not an object or something else.
我研究并查看了 Restangular 的方法。我尝试使用get() 而不是getList() 进行输出,但没有成功。
getAllBalanceListIssues(context: string, month: string): Observable<SusaList[]> {
let url = `/susa?context=${context}`;
if (month !== null) {
url = `${url}&period=${month}`;
}
return this.restAngular.all(url).getList();
}
core.js:6014 ERROR Error: Response for getList SHOULD be an array and not an object or something else
at SafeSubscriber.okCallback [as _next] (ngx-restangular.js:1363)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:185)
at SafeSubscriber.next (Subscriber.js:124)
at Subscriber._next (Subscriber.js:72)
at Subscriber.next (Subscriber.js:49)
at CatchSubscriber._next (Subscriber.js:72)
at CatchSubscriber.next (Subscriber.js:49)
at MapSubscriber._next (map.js:35)
at MapSubscriber.next (Subscriber.js:49)
at MapSubscriber._next (map.js:35)
【问题讨论】:
标签: angular restangular