The earlier concept, simply keeping things separated decouples the reliance of our code on any one element. We can change the markup, the style, or the behavior of our application without necessarily impacting the other two elements.
- Have an ajax form submit normally if the browser does not support ajax
- Make sure client-side generated content has some kind of fall-back view that is generated server-side
- Views that are created by generating and appending DOM elements client-side rather than server-side
Knockout works by using the data attribute to bind to DOM elements. This means
document with typical document behaviors. Take the above example clip. If the
data-bind attributes are ignored we would still get a form with a first and last
name. Indeed, we could even fill that form in server side by assigning
value="Bertington" to the first name and last name inputs.
On top of this, there is something about Knockout that just makes sense. It isn’t as flashy as Angular or Ember. It doesn’t seem to incorporate any new trendy templating systems, massive API libraries, or require us to create half a dozen separate Java script files for controllers, models, and parts of views.