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

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.

主站蜘蛛池模板: 曲阜市| 镇宁| 白山市| 敦煌市| 南召县| 阳泉市| 玉树县| 枣阳市| 深州市| 湘阴县| 遵化市| 章丘市| 迭部县| 白山市| 汪清县| 蓬安县| 绍兴市| 贡觉县| 延安市| 精河县| 临漳县| 巴彦县| 肥西县| 昭平县| 亚东县| 财经| 柳河县| 廉江市| 安岳县| 城口县| 南漳县| 灌南县| 密山市| 罗平县| 罗田县| 奉化市| 洮南市| 沙田区| 揭西县| 莆田市| 安远县|