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

Live Binding ejs with can.observe does not update

$
0
0
I have used live binding in a similar way before, but this time it is not working.

I load an ejs file with only:
  1. <%= this.myData.attr('counter'); %>
I have an observable like this:
  1. this.myData = new can.Observe({
  2.             'counter': 1,
  3.             'something': {ref: 'nothing'}
  4.         });
I load the template like this:
  1. $('.myTemplateElements').html('simpletemplate.ejs', { myData: this.options.myData});
This is in another controler. I have passed the observable at initialization.

The template works (the first time).

If I change the Observe like this:
  1. this.myData.attr('counter', Math.random() );
myData is altered (the counter). I also get the change-Event from the Observe.
But I do not get an update in the template.

What could I be missing for the live binding?

Jochum.


Viewing all articles
Browse latest Browse all 3491

Trending Articles