I read the official Knockout. js documents last Thursday and compiled them into a complete document. If you are interested, you can download them from here.
Introduction to P.S. Knockout. js [from Baidu encyclopedia]
Knockout is a lightweight UI class library that simplifies the JavaScript front-end UI by applying the MVVM mode. Knockout is a JavaScript class library based on the data model that helps you create rich texts, display responses, and edit user interfaces. If your UI needs to be updated automatically at any time (for example, updates depend on user behavior or changes to external data sources), KO can help you easily implement and maintain it easily.
Knockout has the following four important concepts:
◆ Declarative Bindings: it is easy to associate model data to DOM elements using a concise and easy-to-read syntax.
◆ Automatic UI Refresh: when your model state changes, the UI is automatically updated.
◆ Dependency Tracking: establishes an implicit relationship between your model data for transformation and joint data.
◆ Templating: You can quickly compile a complex and nested UI for your model data.
Important features:
◆ Elegant dependency tracing-Your Data Model is updated automatically at any time.
◆ Declarative binding-easily associate the specified part of your user interface with your data model.
◆ Flexible and comprehensive templates-use nested templates to build complex dynamic interfaces.
◆ Easily Scalable-a few lines of code can implement custom behavior as a new declarative binding.
Additional benefits:
◆ Pure JavaScript class library-compatible with any server and client Technology
◆ Can be added to the top of the Web program-no major architecture changes are required
◆ Concise-about 25 KB before Gzip
◆ Compatible with any mainstream browsers (IE 6 +, Firefox 2 +, Chrome, Safari, and others)
◆ Comprehensive suite of specifications (behavior-Driven Development)-this means that it is easy to pass verification on new browsers and platforms.