Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

update.attr / live-binding in EJS - have they ever worked?

$
0
0
I'm wanting views to re-render themselves automatically whenever a model attr changes. To the best of my knowledge this can be achieved by using:

  1. <%== this.attr('foo') %>

However when I changed that attr on that model via the console the view doesn't redraw yet the class returned shows the attr has updated to the new value. Does live-binding in the views actually work or am I using this wrong?

Also, as a result of this not working I've been manually binding in the Controllers to "updated.attr" but that doesn't seem to work either:

  1. this.list.bind('updated.attr', function() { console.log('it works') });
When I change an attr via console the view doesn't redraw. I'm obtaining the model via the model() method on the element the model is bound to.

Any ideas?

Viewing all articles
Browse latest Browse all 3491

Trending Articles