mercredi 12 septembre 2018

Find the class name of a relation from the instance of a model in ember JS

I have foo an instance of the ember-data model thing. thing.js has the following property :

owner: DS.belongsTo('user')

If I have foo with an empty owner, how can I, with only foo and the 'owner' string, retrieve the value 'user' representing the model of the owner relation?




Aucun commentaire:

Enregistrer un commentaire