We have already discussed about Views, ViewModels, Models while we are Getting Started with KnockoutJS. But due to comment of various readers, this post will further simplify the concepts of ViewModel and data binding.
To start of with, please have a look at the image below:
This is the simplest structure of ViewModel that could ever exist. The observable properties that are in the ViewModel, are the properties that a ViewModel could expose, for the purpose of binding with the View (just like Poonam Pandey, for instance).
The properties that ViewModel exposes, can be used to bind with the various properties of the view’s element, like, text, value, enabled, visible and number of other properties available. I hope the two images above would have simplified the concept of binding and exposing properties. For further enquiry, please read Getting Started with KnockoutJS.
Happy Coding!!!
0 comments