我正在尝试使用 ember-data 配置 ember 应用程序以连接并从一个 api 读取数据。我的模型是:
App.Movie = DS.Model.extend
title: DS.attr 'string'
rating_average: DS.attr 'string'
short_plot: DS.attr 'string'
free: DS.attr 'boolean'
我的 api 返回:
{
"pagination": {
"count":xx,
"page": x,
"total_pages": x
},
"movies": [
{
"id": xxxx,
"title": "xxx",
"rating_average": "x",
"short_plot": "xxxx",
"already_seen": x,
....
....
当 ember 尝试加载数据时,它会抛出:
Assertion failed: Your server returned a hash with the key **pagination** but you have no mapping for it
Ember 不期望 Json 中的“分页”键。如何指定仅尝试从键“电影”中读取?