By Oleksii Rudenko January 11, 2015 2:38 PM
Ember.js: One Case When Bindings Do Not Work
Dear readers,
there is one case when two-way bindings do not work. It happens if you bind an array of the simple types such as strings or integer. Check out the next jsbin:
If you change values using the input fields you may expect the plain text values to change. But this does not happen and the reason for that is that the simple types such as strings are not mutable. It means that if one changes a string that belongs to an array, the new string object is created and this new object is not referenced by the array. The array will continue to reference the original string object.
A solution to this is to put the strings in objects like this:
Thanks for reading!