lundi 10 avril 2017

Ember hasMany with multiple models

I'm a bit new to Ember, so please forgive me if this question illuminates my general lack of understanding of the framework.

Basically I am attempting to use Contentful with Ember. I found this addon, which seems to make this pretty simple http://ift.tt/1VIPB9r.

However, I am running into one issue that's beginning to really frustrate me. I have a content type, which has a "many reference" field, which allows a user to reference multiple of many different content types. Essentially, I have a "modules" field, which will be an array of several different modules. Each module will basically be it's own model.

In ember

modules: hasMany('module')

But module can be one of many different models, assuming there needs to be a model that corresponds to each content type.

I have already asked a question here: http://ift.tt/2okzEKO but have been unable to get this working quite yet.




Aucun commentaire:

Enregistrer un commentaire