Skip to content

drjova/template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Javascript template engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published