我的有效载荷如下所示:
var customers = {
"customers":[
{"id":3,"name":"Joe","bio":"some tex","contact":"NY"},
{"id":2,"name":"Rox","bio":"mo' tex","contact":"LA"}
]
};
var orders = {
"orders":[
{"id":1,"customer":3,"amount":20},
{"id":2,"customer":3,"amount":60}
]
};
显然它不会工作,所以我有一个串行器http://mozmonkey.com/2013/12/loading-json-with-embedded-records-into-ember-data-1-0-0-beta/到目前为止工作得很好,为很多关系付出了代价。
ember的商店是否有可能自动检测两种型号的关系?还是必须嵌入?