angular.js - angularjs-ngResource forces the returned data to be object
天蓬老师
天蓬老师 2017-05-15 16:53:15
0
3
568

Error: [$resource:badcfg] Error in resource configuration for action query. Expected response to contain an array but got an object
The query() method requires the server to return an array type, while my backend returns an object containing pagination and other data, and the data member is the post list.
How can I solve this problem without modifying the server?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
淡淡烟草味

Done. Just add a parameter when instantiating the Post model. Wow hahaha

大家讲道理

You can rewrite the query method, I already told you in the QQ group today

PHPzhong

Isn’t it better to just use get?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template