0
votes

I concatinate my application code from multiple js files into one js file. Therefore I can't control the order, and to be honest would not want to. To specify a custom adapter with ember-model you need to create an instance of it like so:

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

So if the CustomAdapter's code appears after the above statement I get the [Uncaught TypeError: Cannot call method 'create' of undefined] error.

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

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

Is there a way around this?

1
you should use the correct order, there is now reliable way around this, IMO the tool you are using to concatenate should support ordering the imports...intuitivepixel
Meh, maintaining order just doesn't seem right...Denzo
it's javascript right? javascript cares about order...intuitivepixel

1 Answers

0
votes

The order of code loading is very, very important. That's just a fact of life. You need to either figure out how to make your current tool load things in the order that you want, or you need a new tool.