jeudi 30 avril 2015

What exactly does Ember.MODEL_FACTORY_INJECTIONS do?

I'm using Ember CLI and by default it seems to set Ember.MODEL_FACTORY_INJECTIONS = true; in app.js.

I tried commenting this line out (and setting it to false) and then my app seemed to behave in some sort of strict mode. I got a bunch of failed assertions because some of my Model relations didn't explicitly specify the inverse.

This is the exact error:

You defined the 'account' relationship on (subclass of DS.Model), but multiple possible inverse relationships of type (subclass of DS.Model) were found on (subclass of DS.Model). Look at http://ift.tt/1aomJhS for how to explicitly specify inverses

Using the default Ember CLI generated app with Ember.MODEL_FACTORY_INJECTIONS = true;, I didn't get these errors. So I'm lead to believe that this flag changes core behaviour somehow.

Insight please!




Aucun commentaire:

Enregistrer un commentaire