Created
November 16, 2011 19:32
-
-
Save enriclluelles/1371075 to your computer and use it in GitHub Desktop.
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
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