Skip to content
A slick library for connecting models to templates
CoffeeScript JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
docs
src
tests
README.markdown
mochup.js
mochup.min.js

README.markdown

Mochup

A speedy framework for creating model-linked HTML views

Example Use:

var users = new mochup.Collection({
    fullName: [function(firstName, lastName){
        return firstName + lastName;
    }, 'firstName', 'lastName']
});

users.add({
    id: 0,
    firstName: "John",
    lastName: "Doe"
});

users.add({
    id: 1,
    firstName: "Jane",
    lastName: "Doe"
});


users.render("<li><a href='/user/{{id}}'>{{fullName}}</a></li>", ul_element);

/* HTML:

<ul>
    <li><a href='/user/0'>John Doe</a></li>
    <li><a href='/user/1'>Jane Doe</a></li>
</ul>
*/
Something went wrong with that request. Please try again.