1

我刚搬到Ember 1.0.0ember-data-v1.0.0-beta.1-87-gc08101e.js。我遇到了很多麻烦。对于初学者:

App.Adapter.configure('plurals', {
    voice_menu : 'voicemenus',
    profile    : 'profile',
    company    : 'companies',
});

我收到此错误消息:

Uncaught TypeError: Object ... has no method 'configure' 

我现在如何配置适配器?

4

1 回答 1

1

configure新的 ember 数据中没有关于 Adapter 的方法。适配器发生了很大变化,因此您应该假设任何现有的自定义都需要重写。

为您的模型定义一个自定义适配器,例如:

App.CompanyAdapter = DS.RESTAdapter.extend({
});

和一个自定义序列化程序,如:

App.CompanySerializer = DS.RESTSerializer.extend({
});

有关详细信息,请参阅转换指南的rest-adapter-and-serializer-configuration部分

于 2013-09-04T16:03:46.827 回答