mardi 24 mai 2016

Using the set function with indexes as keys in Ember

I can't figure out how to use the Ember.set functionality in Ember.JS with indexes. For now I have been using the following code to make this functionality:

this.get('array')[index1][index2].value = value.target.value;

But this keeps giving the following error:

ember.debug.js:16664 Uncaught Error: Assertion Failed: You must use Ember.set() to set the `value` property (of [object Object]) to `xxx`.

I imagine the solution should look something like this:

this.set('array'[index1][index2], value.target.value);

Howerever, I have tried quite a few different forms of the solution above and none of them seems to work.

I am using Ember v1.13 with Node v4.4.3




Aucun commentaire:

Enregistrer un commentaire