【发布时间】:2014-07-04 08:43:52
【问题描述】:
Ember 数据将数据发送到嵌入模型名称的服务器。
{
"part" {
"name" : "test1",
"quantity" : 12
}
}
我希望从响应中删除“部分”字段,使其看起来像:
{
"name" : "test1",
"quantity" : 12
}
我需要它是通用的,以便它适用于我商店中的任何型号。
好的,我找到了 RESTAdapter 中的部分。
serializeIntoHash: function(data, type, record, options) {
var root = underscore(decamelize(type.typeKey));
data[root] = this.serialize(record, options);
},
我试图删除根部分
serializeIntoHash: function(data, type, record, options) {
data = this.serialize(record, options);
}
但它不起作用,它以 {}
响应【问题讨论】:
标签: ember.js ember-data