jeudi 29 septembre 2016

Ember.js - Passing model to Component (by reference)

I have a pretty simple question about ember components. I'm defining my model in my route:

model() {
  return this.store.createRecord('player');
},

I'm passing the model to my component in my template:



Then, inside my component, I can succesfully get the correct data from my model, but nothing that I change in my model is getting sent to the database. I can only assume this is because the model is being passed by value instead of by reference. Is there a way to pass it by reference, and if not, what is the common workaround for editing a model inside of a component.

Thanks!




Aucun commentaire:

Enregistrer un commentaire