Skip to content

Using handlebars templates with marionette

geekdave edited this page Jul 3, 2012 · 6 revisions

The easiest way to use Handlebars with Marionette, including support for AMD / RequireJS, is with the Marionette.Handlebars add-on from @AsciiDisco.
Note that this plugin is not yet compatible with Marionette > 0.9.x.

Alternatively, you can use the following code in your main application or main.js file:

    Backbone.Marionette.TemplateCache.prototype.compileTemplate = function(rawTemplate) {
        return Handlebars.compile(rawTemplate);
    };