mercredi 29 juillet 2015

Ember - how to convert this.get('model') to a js object

I am building an Ember component and it's being passed a model

{{ratings-summary-comp model=model}}

So you can call this model inside an action on the component's js file, like this:

this.get('model')

When I log this in the browser console, it outputs some kind of class thing. I want to convert this to a normal JS-object consisting of the model's attributes, so I can call the attributes like this:

model["attribute"]

How?




Aucun commentaire:

Enregistrer un commentaire