Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fouad/bound

Object data binding to DOM elements
https://github.com/fouad/bound

Last synced: 2 months ago
JSON representation

Object data binding to DOM elements

Awesome Lists containing this project

README

        

# bound

Object data binding to DOM elements

## Installation

$ component install fouad/bound

## API
```javascript
var bound = require('bound');

var model = {
id: 123,
name: {
value: "Steve Jobs",
handler: function(val) {
return val + " is smart";
}
},
talking: {
value: 17,
handler: function(val) {
return val+"%";
}
}
};

var o = bound(model, ".certain-identifier");

// optional statement - can be pre-rendered on page-load (recommended!)
o.render();

setTimeout(function() {
o.set("name", "Tim Cook")
}, 1000);
```
## License

MIT