tplify
v0.0.7
Published
A simple html template compiler plugin for Browserify
Downloads
5
Maintainers
Readme
tplify
A Browserify plugin used internally at Timpex AS that allows to require
html templates.
Installation
npm install tplify
Add to build
browserify({...})
.plugin('tplify')
.bundle();
Usage
Javascript
var view = require('./path/to/view.tpl.html');
view.activate(parentNode);
view.deactivate();
view.setData({data-property: value, ...});
view.getData(); // => {data-property: value, ...}
view.data-name; // => HTMLElement
Template
// available for view.setData({someProperty: value}) and view.getData();
<div data-property="someProperty"></div>
// available as property on view.someName
<div data-name="someName"></div>