This project is under heavy development, and the API has not solidfied yet. Don't use this for anything important...yet.
Bind data to DOM with zero configuration. Just call
FillFillUses plain HTML with no extra templating markupRuns on the client or server (with jsdom)Render arrays without loops or partialsNested objects and collectionsCompatible (tested on IE6+, Chrome and Firefox)
npm install fill or get the
compiled and minified version
and include it to your application. jQuery is optional, but if you happen to
use it, fill registers itself as a plugin.
For server-side use, see
spec folder and the awesome
jsdom for the details.
name attribute and
data-bind attribute. Values are escaped before rendering.
Any keys that are prefixed with an underscore are treated as attributes (with
the exception of _text and _html).
var hello =_class: 'message'hello: 'Hello'goodbye: 'Goodbye!'span: '<i>See Ya!</i>'greeting: 'Howdy!''hi-label': 'Terve!' // Finnish i18n;// with jQuery;// ..or without;
var activities =activity:'Jogging''Gym''Sky Diving';;// or;
var comments =body: "That rules"body: "Great post!";
commentThat rulescommentGreat post!
var post =title: 'Hello World'post: 'Hi there it is me'comment:name: 'John'text: 'That rules'name: 'Arnold'text: 'Great post!';;
Hello WorldHi there it is meJohnThat rulesArnoldGreat post!
var person =firstname: 'John'lastname: 'Wayne'address:street: '4th Street'city: 'San Francisco'zip: '94199';;
JohnWayne4th Street94199San Francisco
// prefix with a dollar sign to find all matches// otherwise it will only find the first onevar post =$hello: 'hi';;
You need node.js 0.6.x and npm.
npm install npm install -g uglify-js
Run tests during development for more verbose assertion output
node_modules/jasmine-node/bin/jasmine-node --verbose spec
All the following are appreciated, in an asceding order of preference
In case the contribution is going to change fill API, please create a ticket first in order to discuss and agree on design.
This project was forked from the very impressive Transparency project to attempt the following: