knockout.js + handlebars
class HandlebarsTemplateEngine extends ko.templateEngine | |
renderTemplateSource: (compiledTemplate, bindingContext, options) -> | |
data = bindingContext.$data | |
htmlResult = compiledTemplate(data) | |
ko.utils.parseHtmlFragment(htmlResult) | |
makeTemplateSource: (template, templateDocument) -> | |
throw "Could not find a template named: '#{template}'" unless JST[template] | |
JST[template] | |
# TODO: Figure out what this method is supposed to do | |
isTemplateRewritten: -> | |
true | |
ko.setTemplateEngine new HandlebarsTemplateEngine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment