Created
February 14, 2011 18:58
-
-
Save arkitrave/826350 to your computer and use it in GitHub Desktop.
Step One
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
handlebars : { | |
cache: [], | |
render : function (name, template, content, context, callback) { | |
try { | |
if (!cache[name]) { | |
cache[name] = Handlebars.compile(template); | |
} | |
callback(cache[name](content, context)); | |
} catch (e) { | |
// console.log('Could not render. Handlebars might not be installed'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment