Skip to content

Commit

Permalink
added an example using echo and include
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar Otero committed Jul 18, 2017
1 parent 25486a4 commit 9252132
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/output-function.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@
});
-%>
</ul>

<ul>
<%
users.forEach(function (user) {
echo(include('./partial.ejs', {user: user}));
});
%>
</ul>
4 changes: 4 additions & 0 deletions examples/partial.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<li>
<strong><%= user.name %></strong>
is a <%= user.age %> year old <%= user.species %>
</li>

0 comments on commit 9252132

Please sign in to comment.