官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 密云县| 左云县| 博罗县| 来凤县| 光泽县| 万荣县| 平远县| 金堂县| 海原县| 佛教| 泗洪县| 甘南县| 丰县| 平乡县| 搜索| 东光县| 安溪县| 山东省| 凌海市| 汕头市| 浮梁县| 津市市| 城步| 晋江市| 商南县| 瓦房店市| 商南县| 宁河县| 报价| 双柏县| 新巴尔虎左旗| 庐江县| 石门县| 凌云县| 丰台区| 澄城县| 扶余县| 苗栗县| 陇南市| 广汉市| 镇宁|