Correct, you might have to initialize the template separately. This can be either in a separate file or from a string like this:
- can.view('comobobox.ejs', {
- itemView: can.view.ejs('<span><%= this.attr('title') %></span>')
- });
- // combobox.ejs
- <ul class="combobox">
- <% items.each(function(item) { %>
- <li class="item"><%== itemView.render(item) %></li>
- <% }) %>
- </ul>
I found that with live binding I generally don't really need many nested templates though.