- 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.
推薦閱讀
- Data Visualization with D3 4.x Cookbook(Second Edition)
- C#高級編程(第10版) C# 6 & .NET Core 1.0 (.NET開發經典名著)
- 在最好的年紀學Python:小學生趣味編程
- Scratch 3.0少兒編程與邏輯思維訓練
- 深入理解Android:Wi-Fi、NFC和GPS卷
- 零基礎趣學C語言
- Java面向對象程序設計
- MySQL從入門到精通(軟件開發視頻大講堂)
- iOS自動化測試實戰:基于Appium、Python與Pytest
- 精通MySQL 8(視頻教學版)
- 動手打造深度學習框架
- 超簡單:用Python讓Excel飛起來(實戰150例)
- Learning Kotlin by building Android Applications
- WCF編程(第2版)
- 數據結構:C語言描述(融媒體版)