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

Re : "micro" controller for each list item - i am messing this up, need help!!

$
0
0
Element callbacks need to be done inside of the HTML tag. You have:

  1. <div class="ranking"><%= (el)-> new options.ratingtutor($(el).find('.ranking'), {item: item}) %></div>

When what you want is:

  1. <div class="ranking" <% (el)-> new options.ratingtutor(el, {item: item}) %>></div>

In the code you have, I'm not sure what EJS would use for el, I'm actually surprised your code renders at all since element callbacks shouldn't work outside of an HTML tag. The wonkiness you are seeing is likely caused by your placement of the element callback. Try it with the modified code and post if you are still having problems.

Viewing all articles
Browse latest Browse all 3491

Trending Articles