Skip to content

Instantly share code, notes, and snippets.

@patrick-steele-idem
Created July 2, 2012 16:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save patrick-steele-idem/3034264 to your computer and use it in GitHub Desktop.
Template comparison
-----------------
Option A:
Hello {{name}}!
{{#hasItems}}
<ul>
{{#items}}
<li>{{.}}</li>
{{/items}}
</ul>
{{/hasItems}}
-----------------
Option B:
Hello <%=name%>!
<% if (items.length) { %>
<ul>
<%_.each(items, function(i){%>
<li><%=i%></li>
<%});%>
</ul>
<% } %>
-----------------
Option C:
Hello ${name}!
<ul c:if="notEmpty(items)">
<li c:for="item in items">
${item}
</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment