rendfall / test-templates

Demo:
http://rendfall.github.io/test-templates/demo/
1 stars 0 forks source link

Templates

Tiny library to generate template with data binding.

Usage

Template:

<div id="content">
    <h1>{{ title }}</h1>
    <img src="https://github.com/rendfall/test-templates/raw/master/{{ link }}" />
    <p>{{ nodef }}</p>
</div>

Render:

var $content = document.getElementById('content');

$content.innerHTML = Template.compile($content.innerHTML, {
    title: 'This is an example',
    link: 'http://fakeimg.pl/250x100/ff0000/'
});

Unit tests

$ npm test