Skip to content Skip to sidebar Skip to footer

Integrating Icanhaz And Marionette

I'm a big fan of ICanHaz, and I'm trying to directly intregrate it into a new Marionette application I'm building. However, going off this post, I have written this that reaches in

Solution 1:

Okay, I couldn't find an easy way to do this using ICH. However, due to another SO I found, very similar functionality can be found just using Mustache.

Using this code:

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

Lets you change the renderer so you can pull mustache templates from index.html using Marionette's template call. A mustache template looks like this:

<scriptid="headerTemplate"type="text/template"><p>{{user_name}}</p><p>{{tenant}}</p></script>

The difference is that the type is 'text/template' as opposed to 'text/html'. Otherwise it acts very similar.

Hope this helps someone else.

Post a Comment for "Integrating Icanhaz And Marionette"