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

Re : model.attr() in the view template?

$
0
0
Yes it would. Providing you wanted to setup live-binding.

If you do as you show above live-binding will be enabled. What that means is that whenever the value of the "foo" property changes (as long as it was changed using .attr( "foo", SOME_NEW_VALUE" ), then the value displayed in the DOM will automagically be updated. It's a amazing feature.

You can just do:
  1. <%= model.foo %>

But then you won't get live-binding.

The choice is yours...

Viewing all articles
Browse latest Browse all 3491

Trending Articles