Skip to content

Instantly share code, notes, and snippets.

View mvaello's full-sized avatar
✈️
Working @ AIRBUS

Miguel Vaello mvaello

✈️
Working @ AIRBUS
  • Spain
View GitHub Profile
@mvaello
mvaello / gist:2949345
Created June 18, 2012 16:45 — forked from zenitraM/gist:2949330
Simple template engine
/* Templates to load: */
function Template(templateUrl) {
this.template = false;
this.compiledTemplate= false;
this.templateUrl = templateUrl;
this.draw = function(contents) {
//We compile the template if it isn't compiled yet.
this.compiledTemplate = this.compiledTemplate || Handlebars.compile(this.template);
return this.compiledTemplate(contents);