Home

Awesome

requirejs-hogan

Simple Hogan plugin for RequireJS.

Example usage

define(['hgn!myTemplate.tpl'], function(myTemplate) {

    var html = myTemplate.render({name:'John Doe'});

});

Example config

require.config({
    paths: {
        'text': 'lib/requirejs-text/text',
        'hogan': 'lib/hogan/web/builds/2.0.0/hogan-2.0.0.amd',
        'hgn': 'lib/requirejs-hogan/hgn'
    },
    shim: {
        'hogan': {
            exports: 'Hogan'
        }
    }
});