Skip to content

scottcorgan/domy-bind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

domy-bind

Two-way data binding. For use with Browserify.

Part of the Domy module collection.

browser support

Install

npm install domy-bind --save

Usage

var bind = require('domy-bind');
var insert = require('domy-insert');

var html = [
  '<div>',
  '  <h2>{{title}}</h2>',
  '  <p>{{description}}</p>',
  '</div>'
].join('\n');

var data = {
  title: 'Title',
  description: 'Description'
};

var element = bind(html).to(data);

insert(element).end();

data.title = "New Title"; // Html/DOM will update when this is changed

Run Tests

Requires Phantomjs is installed

npm install
npm test

About

Two-way data binding for front-end Browserify code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published