- KnockoutJS Essentials
- Jorge Ferrando
- 218字
- 2021-07-23 20:16:15
KnockoutJS and the MVVM pattern
KnockoutJS is a very lightweight library (just 20 KB minified) that gives the ability to objects to become the nexus between views and models. It means that you can create rich interfaces with a clean underlying data model.
For this purpose, it uses declarative bindings to easily associate DOM elements with model data. This link between data and presentation layer (HTML) allows the DOM to refresh displayed values automatically.
Knockout set up chains of relationships between model data to transform and combine it implicitly. Knockout is also trivially extensible. It is possible to implement custom behaviors as new declarative bindings. This allows the programmer to reuse them in a just few lines of code.
The advantages of using KnockoutJS are many:
- It's free and open source.
- It is built using pure JavaScript.
- It can work together with other frameworks.
- It has no dependencies.
- It supports all mainstream browsers, even ancient ones such as IE 6+, Firefox 3.5+, Chrome, Opera, and Safari (desktop/mobile).
- It is fully documented with API docs, live examples, and interactive tutorials.
Knockout's function is specific: to join views and models. It doesn't manage DOM or handle AJAX requests. For these purposes, I would recommend jQuery. Knockout gives us the freedom to develop our code the way we want.

MVVM-pattern diagram
- Mastering Concurrency Programming with Java 8
- Java技術手冊(原書第7版)
- 深入理解Java7:核心技術與最佳實踐
- Building a Quadcopter with Arduino
- 飛槳PaddlePaddle深度學習實戰
- 計算機應用基礎教程(Windows 7+Office 2010)
- Canvas Cookbook
- Learning Node.js for .NET Developers
- 案例式C語言程序設計實驗指導
- Django實戰:Python Web典型模塊與項目開發
- Access 2010數據庫應用技術實驗指導與習題選解(第2版)
- Raspberry Pi Robotic Blueprints
- Java 9 Programming By Example
- 分布式架構原理與實踐
- Oracle SOA Suite 12c Administrator's Guide