samedi 16 avril 2016

Ember Data - Polymorphic relation to any type

Let say that I want to develop a feature to handle entity historic. When fetching historic entries, each historic entry could be bound to an application model entity.

To avoid creating a generic historic model and extend all the models in the application, how could I achieve the polymorphism?

//models/historicentry
export default DS.Model.extend({
    entity:DS.belongsTo('????', {polymorphic:true})
    ...
});




Aucun commentaire:

Enregistrer un commentaire