Knockout provides an elegant way of updating the user interface using Javascript View models. Javascript has an inheritance model. With that, we can create a hierarchy of classes. Consider the following HTML with Knockout bindings.
<div id="main"> <div data-bind="text: name"></div> <div data-bind="text: detail"></div> </div>
We use a simple Model class. Load it with data. And bind it to the HTML.
var model = new Model(); model.load();…