0

我将我的应用程序代码从多个 js 文件合并到一个 js 文件中。因此我无法控制顺序,老实说也不想。要使用 ember-model 指定自定义适配器,您需要像这样创建它的实例:

App.User.adapter = Ember.CustomAdapter.create();

因此,如果 CustomAdapter 的代码出现在上述语句之后,我会收到[Uncaught TypeError: Cannot call method 'create' of undefined]错误。

App.User.adapter = App.CustomAdapter.create();

App.CustomAdapter = Ember.Adapter.extend({
    // custom
});

有没有解决的办法?

4

1 回答 1

0

代码加载的顺序非常非常重要。这只是生活中的事实。您需要弄清楚如何让您当前的工具按照您想要的顺序加载内容,或者您​​需要一个新工具。

于 2013-10-04T19:10:13.950 回答