Skip to content

alfateam/tplify

Repository files navigation

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>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published