I have a simple example in which a nested property fails to live bind and propagate the change to the template. I change an attribute of an array index inside an object and nothing changes on the view.
- var obj = {
todos: [ 'Line #1', 'Line #2', 'Line #3' ],
message: 'Hello',
count: 2
};
var cObj = new can.Observe(obj);
var template = can.view('example.mustache', cObj);
can.$(document.body).append(template);
Template is as follows (example.mustache)
If I do
- <ul>
{{#todos}}
<li>{{.}}</li>
{{/todos}}
</ul>
<div>{{message}}</div>
If I do
cObj.attr('todos.1', 'Line #2 Changed');
then nothing happens. However, if I do
cObj.attr('message', 'Hello Again');
then the message changes properly.
Any help is appreciated.