Skip to content

Instantly share code, notes, and snippets.

@enriclluelles
Created November 16, 2011 19:32
Show Gist options
  • Save enriclluelles/1371075 to your computer and use it in GitHub Desktop.
Save enriclluelles/1371075 to your computer and use it in GitHub Desktop.
Views = {
render: function (name, locals) {
var tmpl = $("[name=" + name + "]").html();
var locals = locals || {};
return require("jade.js").compile(tmpl)(locals);
},
replace: function (sel, name, locals) {
return sel.html(this.render(name, locals));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment