Skip to content

Instantly share code, notes, and snippets.

@vadimdemedes
Created March 22, 2013 12:55
Show Gist options
  • Save vadimdemedes/5221027 to your computer and use it in GitHub Desktop.
Save vadimdemedes/5221027 to your computer and use it in GitHub Desktop.
var template = new Chute.View.Template({
html: '<h1><%= title %></h1>',
render: function(data, callback) {
var compiledFn = _.template(this.template);
var rendered = compiledFn(data);
callback(rendered);
}
});
template.render({ title: 'I am a LoDash template' }, function(result){
// result = <h1>I am a LoDash template</h1>
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment