Skip to content

Latest commit

 

History

History
42 lines (35 loc) · 787 Bytes

README.md

File metadata and controls

42 lines (35 loc) · 787 Bytes

template.js

Description

A javascript template engine

Usage

$('#test').template({ 
    'firstname' : 'A firstname',
    'lastname'  : 'A lastname',
    'positions' : [
        {'title':'A position title', 'year': 'A year'},
        {'title':'A position title', 'year': 'A year'},
        {'title':'A position title', 'year': 'A year'},
        {'title':'A position title', 'year': 'A year'}
        ],
    'age' : false
})
<div id="test">
    <p data-replace="firstname"></p> 
    <ul data-repeat="positions"> 
        <li><span data-replace="title"></span></li>
    </ul>
    <p data-logic="!age">Guess what no age!</p>
</div>

Documentation

See demo/index.html

More Details

See template.html