added an example using echo and include

This commit is contained in:
Oscar Otero
2017-07-18 08:21:22 +02:00
parent 25486a438b
commit 9252132115
2 changed files with 12 additions and 0 deletions

View File

@@ -8,3 +8,11 @@
});
-%>
</ul>
<ul>
<%
users.forEach(function (user) {
echo(include('./partial.ejs', {user: user}));
});
%>
</ul>

4
examples/partial.ejs Normal file
View File

@@ -0,0 +1,4 @@
<li>
<strong><%= user.name %></strong>
is a <%= user.age %> year old <%= user.species %>
</li>