Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/fouad/bound
- Owner: fouad
- Created: 2013-04-04T00:13:22.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-04T18:42:05.000Z (almost 12 years ago)
- Last Synced: 2024-04-10T23:52:19.172Z (10 months ago)
- Language: CoffeeScript
- Size: 109 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
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);
```
## LicenseMIT