Created
May 21, 2012 00:37
-
-
Save ForbesLindesay/2760057 to your computer and use it in GitHub Desktop.
EJS - Blog Post
This file contains 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
<ul> | |
<% for(var i = 0; i<items.length; i++){ %> | |
<li><%= items[i].name %></li> | |
<% } %> | |
</ul> |
This file contains 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
<% //Comments work as you would expect %> | |
<% /* This example would work great for showing a login/logout button */ %> | |
<button id="toggleLogin"> | |
<% if(user.isLoggedIn) { %> | |
Log Out | |
<% } else { %> | |
Log In | |
<% } %> | |
</button> |
This file contains 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
<ul> | |
<% items.forEach(function(item){ %> | |
<li><%= item.name %></li> | |
<% } %> | |
</ul> |
This file contains 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
<%= text %> |
This file contains 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
<%- text %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment