domy-bind

0.1.0 • Public • Published

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 html = [
  '<div>',
  '  <h2>{{title}}</h2>',
  '  <p>{{description}}</p>',
  '</div>'
].join('\n');
 
var data = {
  title: 'Title',
  description: 'Description'
};
 
var element = bind(html).to(data);
 
document.body.appendChild(element);
 
data.title = "New Title"; // Html/DOM will update when this is changed

Run Tests

Requires Phantomjs is installed

npm install
npm test

Readme

Keywords

none

Package Sidebar

Install

npm i domy-bind

Weekly Downloads

3

Version

0.1.0

License

MIT

Last publish

Collaborators

  • scottcorgan