Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 503 Bytes

template.md

File metadata and controls

26 lines (18 loc) · 503 Bytes

模板工具


使用帮助参考 https://github.com/ecomfe/etpl

使用示例

——————————

    var tpl = require('template');

    var html = require('text!./tpl.html');

    var render = tpl.compile('hello ${name}!');
    var data = render({name: 'mockservice'});

    // render from html which includes multi targets

    // compile html
    tpl.compile(html);

    tpl.getRenderer('title')({
        name: 'my cloud',
        city: 'beijing'
    });