Skip to content

0.3.0 Module

Ivan S Glazunov edited this page Feb 20, 2015 · 2 revisions

sources/module

Templates.Module

[new] T.Module(data: TData) => [new] (...arguments: any[]) => this;

Universal renderer for any type data.

Arguments for data-mixin send to second call quotes.

console.log(T.Module('<%= a %>')().context({ a: 1 }));
// 1
console.log(T.Module(T.mixin(function(a, b, c) { return a+b+c }))(1, 2, 3));
// 6
console.log(T.Module(T.data(1, '<%= a %>', 3)).context({ a: 2 }));
// 123
console.log(T.Module(T.doubles.div(1, '<%= a %>', 3)).context({ a: 2 }));
// <div>123</div>
Clone this wiki locally