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

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.

主站蜘蛛池模板: 新宁县| 华宁县| 乌恰县| 安阳市| 龙岩市| 平原县| 枞阳县| 军事| 子洲县| 江永县| 城步| 华坪县| 苍山县| 任丘市| 克拉玛依市| 沭阳县| 赤城县| 延边| 荆门市| 泊头市| 河源市| 张家港市| 水富县| 阳原县| 宣城市| 虹口区| 塘沽区| 广安市| 海城市| 古蔺县| 汝州市| 裕民县| 宝清县| 平乐县| 林芝县| 综艺| 额尔古纳市| 安西县| 松潘县| 江津市| 章丘市|