- HTML5 Web Application Development By Example Beginner's Guide
- J.M. Gustafson
- 127字
- 2021-08-13 16:50:27
Data binding with custom attributes
A great use for custom data attributes is to implement data binding. Data binding allows us to map user controls in the DOM to fields in the data model so that they are automatically updated when the user changes them. Using this technique we can eliminate a lot of boring repetitive code that does nothing more than handle events and map fields in the view to fields in the model.
Note
There are a few excellent data binding libraries available for JavaScript, including Backbone.js
and Knockout
. We will implement our own simple data binding here to learn how to use custom attributes. If you find yourself building an application with a lot of data you might consider using one of these libraries.
推薦閱讀
- Advanced Machine Learning with Python
- 從零構建知識圖譜:技術、方法與案例
- FuelPHP Application Development Blueprints
- Docker and Kubernetes for Java Developers
- Building Modern Web Applications Using Angular
- Scala Design Patterns
- Practical Windows Forensics
- Python金融數據分析
- SEO實戰密碼
- 軟件項目管理實用教程
- OpenCV 3 Blueprints
- Windows Phone 8 Game Development
- WordPress Search Engine Optimization(Second Edition)
- TypeScript全棧開發
- Java程序設計教程