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

Live binding not working in handler of mustache template

$
0
0
The below handler does not work for live binding
  1. can.Mustache.registerHelper("each_with_key", function(obj, options) {
  2.     var buffer = "",key;
  3.     for (key in obj) {
  4.         if (obj.hasOwnProperty(key)) {
  5.             buffer += options.fn({key: key, value: obj[key]});
  6.         }
  7.     }
  8.     return buffer;
  9. });
My template is like this
  1. {{#each_with_key model}}
  2. <li><span>{{key}}</span> <span>{{value}}</span></li>  
  3. {{/each}}

http://jsfiddle.net/samarjit/kuWM2/ 


Viewing all articles
Browse latest Browse all 3491

Trending Articles