Created
July 15, 2014 18:59
-
-
Save shaneriley/99133ec9811161c2ea50 to your computer and use it in GitHub Desktop.
Precompile all Handlebars templates
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
var templates = (function() { | |
var o = {}; | |
$("[type=\"text/x-handlebars\"]").each(function() { | |
o[$(this).attr("data-id")] = Handlebars.compile(this.innerHTML); | |
}); | |
return o; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment