Created
June 5, 2016 02:24
-
-
Save jonathanccalixto/a3223950577e9de3d3e00acc1f3ee5f2 to your computer and use it in GitHub Desktop.
A shim to use Handlebars in Backbone template.
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
Backbone.Marionette.Renderer.render = function (template, data) { | |
if (_.isObject(template) && template.type === "handlebars") { | |
return template.template(_.extend(data, template.data), template.options); | |
} | |
return template(data); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment