Closed wclr closed 13 years ago
I am fairly sure you need to output the returned view e.g.:
<% $.each(this, function(i, item){ %>
<%= view(commonViewsPath + "items/item.ejs", item) %>
<% }) %>
Or even better:
<% $.each(this, function(i, item){ %>
<%= $.View(commonViewsPath + "items/item.ejs", item) %>
<% }) %>
I am surprised that
<li>this.attr</li>
Worked though, I would expect it to be
<li><%= attr %></li>
Well but then there is another issue.
You are right about
Yes now If I use "<%=" instead of "<%" i've got the rendering result BUT as a result i've got raw HTML (text with tags) on the screen.
and in 3.1 it workd without "<%=" but with "<%" and i believe view in EJS files acts as a shortcut for $.View.
Yes it pretty much is a shortcut for $.View which just returns the view and doesn't render it. If you want to render unescaped use "<%==".
ok, thank you, David =)
Well, it seems that nested views do not render.
I've got my main view:
<% $.each(this, function(i, item){ %> <% view(commonViewsPath + "items/item.ejs", item) %> <% }) %>
and nestd view item.ejs:
It worked with JVMC 3.1 But now i've got notghing inside my main view (though item.ejs is download from server and definitely render is called - I've debuged it in jquery\view\ejs\ejs.js)
if I replace this call of the nested view with inline HTML:
<% $.each(this, function(i, item){ %>
<% }) %>
I've got what it should be.