README
A template engine built on the top of ES6 template literals syntax and Google IncrementalDOM.
Install
$ npm i skin-template --save
$ bower i skin-template --save
Quick use
Import the library:
<script src="path/to/skin-template.js"></script>
Bootstrap a template:
var template = new Skin('name', 'age', ' \
<div class="card"> \
<span class="user-name">${name}</span> \
<span class="user-age">${age}</span> \
</div> \
');
template.render(document.body, 'Alan', 11);
Limitations
- At the moment, only html wrapped by "`" (backtiks) is supported. Any other string will be ignored by the compiled and treat as function statement.
- If you are targeting ES5 browsers, remember that the template string will not be transpiled during your build process.