Skip to content

Instantly share code, notes, and snippets.

@wyattdanger
Created December 18, 2009 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wyattdanger/259618 to your computer and use it in GitHub Desktop.
Save wyattdanger/259618 to your computer and use it in GitHub Desktop.
var compiled = _.template("hello: <%= name %>");
compiled({name : 'moe'});
=> "hello: moe"
var list = "<% _.each(people, function(name) { %> <li><%= name %></li> <% }); %>";
_.template(list, {people : ['moe', 'curly', 'larry']});
=> "<li>moe</li><li>curly</li><li>larry</li>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment