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

  • KnockoutJS Essentials
  • Jorge Ferrando
  • 211字
  • 2021-07-23 20:16:15

Installing components

To develop our real-world project, we need to install a few components and set up our first layout.

These are all the components you need to download:

Since we just work on the client side in the first chapters, we can mock data in the client and will not need a server side for now. So we can choose any place in our computer to start our project. I recommend you use the environment you usually employ to do your projects.

To start, we create a folder called ko-cart and then create three folders and a file inside it:

  1. In the css folder, we will put all our css.
  2. In the js folder, we will put all our JavaScript.
  3. In the fonts folder, we will put all the font files needed by the Twitter Bootstrap framework.
  4. Create an index.html file.

Now you should set up your files the same way as shown in the following screenshot:

Installing components

The initial folder structure

Then we should set the content of the index.html file. Remember to set all the links to the files we will need using the <script> and <link> tags:

<!DOCTYPE html>
<html>
<head>
  <title>KO Shopping Cart</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body>
  <script type="text/javascript" src="js/vendors/jquery.min.js">
  </script>
  <script type="text/javascript" src="js/vendors/bootstrap.min.js">
  </script>
  <script type="text/javascript" src="js/vendors/knockout.debug.js">
  </script>
</body>
</html>

With these lines of code, we have all we need to start our application.

主站蜘蛛池模板: 新营市| 中西区| 白山市| 临邑县| 浏阳市| 莱阳市| 弋阳县| 哈尔滨市| 龙江县| 顺平县| 中宁县| 仙桃市| 沽源县| 西林县| 辉县市| 乌兰浩特市| 瑞安市| 怀安县| 库伦旗| 屏山县| 九台市| 仪陇县| 曲靖市| 临漳县| 安岳县| 乌恰县| 西盟| 安泽县| 沈阳市| 维西| 梁河县| 阳高县| 伊金霍洛旗| 赤壁市| 邵阳市| 保靖县| 抚州市| 海盐县| 磴口县| 永泰县| 同江市|