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

Chapter 2. KnockoutJS Templates

Once we have built our Catalog, it is time to add a cart to our application. When our code begins to grow, it's necessary to split it in several parts to keep it maintainable. When we split JavaScript code, we are talking about modules, classes, function, libraries, and so on. When we talk about HTML, we call these parts templates.

KnockoutJS has a native template engine that we can use to manage our HTML. It is very simple, but also has a big inconvenience: templates, it should be loaded in the current HTML page. This is not a problem if our app is small, but it could be a problem if our application begins to need more and more templates.

In this chapter, we are going to design our templates with the native engine and then we will speak about mechanisms and external libraries we can use to improve the Knockout template engine.

主站蜘蛛池模板: 德保县| 凭祥市| 惠州市| 宁强县| 平遥县| 报价| 旬阳县| 石棉县| 电白县| 天门市| 石城县| 招远市| 南涧| 连平县| 咸丰县| 离岛区| 鹤峰县| 大安市| 尼勒克县| 诸城市| 宁晋县| 桃江县| 饶河县| 赤水市| 托克托县| 榆中县| 神池县| 朝阳县| 丹凤县| 清水河县| 武穴市| 宜君县| 宜兰市| 正定县| 新巴尔虎右旗| 丰顺县| 四川省| 洪雅县| 秀山| 婺源县| 青田县|