Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 669 Bytes

README.md

File metadata and controls

35 lines (22 loc) · 669 Bytes

Macho.jquery.js

A jQuery plugin for Hogan.js

Basically, it's simply an extension to jQuery to apply Hoggan.js templating at the selected DOM element.

Here's a usage example:

var myData = {"myKey": "myValue"};

$('#myTemplateId').Macho(myData)

It is equivalent to:

var myData = {"myKey": "myValue"};

var html = $('#myTemplateId').html();

var template = _hogan.compile(html);
var output = template.render(myData);

$('#myTemplateId').html(output);

Having:

<div id="myTemplate">{{myKey}}</div>

Author: Seraf Dos Santos <webmaster [at] cyb3r.ca> – MIT License – copyright (c) 2012 Seraf Dos Santos