Binding data with Object.observe
In this article we’ll try to implement a minimal data-binding framework using new fancy
Object.observe API which everyone’s in love with. We’ll go step by step and try to solve all of the problems appear on our way. The resulting framework is not by any means production-ready, though I’ll publish it on Github for this tutorial needs only.
Data binding, eh?
Modern MVC frameworks like AngularJS or EmberJS gained their popularity for saving developer’s time in the era of ajax web-oriented applications. Mostly this is done by implementing data-to-html binding, so that a developer can focus on code and don’t care about the views much — they are updated accordingly automatically. This removes the need of working with DOM directly and thus reduces the effort dramatically.
Until very recent time, there were only two ways of binding your data.
One is putting your model object into a wrapper
Continue reading →