Created
July 2, 2012 16:58
-
-
Save patrick-steele-idem/3034264 to your computer and use it in GitHub Desktop.
Template comparison
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------- | |
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