This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
templates
Eser Ozvataf edited this page May 21, 2015
·
5 revisions
Templates is a container which consists of external template engine such as Hogan, Mustache, Handlebars, etc. It simply behaves as a proxy that enhances inner template engine with some helper methods.
Usage: $l.templates.engine = engineName;
// available options: plain, hogan, mustache, handlebars, lodash and underscore.
$l.templates.engine = 'hogan';
Usage: $l.templates.apply(element, model[, options])
// let's say it's: Hello {{name}}
var source = $l.id('template-source');
var template = $l.templates.apply(source, { 'name': 'Eser' });
console.log(template);
reads #template-source
's contents, applies model on template, returns generated content,
then prints: Hello Eser
Please don't hesitate to submit issues and pull requests.