lundi 11 juillet 2016

Ember binding on custom objects

See twiddle here: http://ift.tt/29xmfqP

Basically, in crit-service I create Ember Objects "Crits" and "Crit", and fill them with some data.

The crit-service is used by two different components, which basically do the same thing: display the Crits.

The problem is that the "change" buttons do not work. By debugging, I see that the values are changed, but the view is not updated. Why is this? Since Ember.Object is Observable, shouldn't setting a value notify the template? And most importantly, how can I get this to work?

P.S. I've seen a workaround by using Ember.A() instead of Objects. However, this would add boilerplate, as my data model is really objects and not arrays of key-value pairs.

Aucun commentaire:

Enregistrer un commentaire