基础案例:TodoMVC[通俗易懂]

基础案例:TodoMVC[通俗易懂]起步下载模板:gitclonehttps://github.com/tastejs/todomvc-app-template.git–depth1初始化项目:ngnewtodom

大家好,又见面了,我是你们的朋友全栈君。

起步

下载模板:

git clone https://github.com/tastejs/todomvc-app-template.git --depth 1

初始化项目:

ng new todomvc-angular
cd todomvc-angular
ng serve

todomvc-angular\src\app\app.component.html 文件内容替换如下:

<section class="todoapp">
  <header class="header">
    <h1>todos</h1>
    <input class="new-todo" placeholder="What needs to be done?" autofocus>
  </header>
  <!-- This section should be hidden by default and shown when there are todos -->
  <section class="main">
    <input id="toggle-all" class="toggle-all" type="checkbox">
    <label for="toggle-all">Mark all as complete</label>
    <ul class="todo-list">
      <!-- These are here just to show the structure of the list items -->
      <!-- List items should get the class `editing` when editing and `completed` when marked as completed -->
      <li class="completed">
        <div class="view">
          <input class="toggle" type="checkbox" checked>
          <label>Taste JavaScript</label>
          <button class="destroy"></button>
        </div>
        <input class="edit" value="Create a TodoMVC template">
      </li>
      <li>
        <div class="view">
          <input class="toggle" type="checkbox">
          <label>Buy a unicorn</label>
          <button class="destroy"></button>
        </div>
        <input class="edit" value="Rule the web">
      </li>
    </ul>
  </section>
  <!-- This footer should hidden by default and shown when there are todos -->
  <footer class="footer">
    <!-- This should be `0 items left` by default -->
    <span class="todo-count"><strong>0</strong> item left</span>
    <!-- Remove this if you don't implement routing -->
    <ul class="filters">
      <li>
        <a class="selected" href="#/">All</a>
      </li>
      <li>
        <a href="#/active">Active</a>
      </li>
      <li>
        <a href="#/completed">Completed</a>
      </li>
    </ul>
    <!-- Hidden if no completed items are left ↓ -->
    <button class="clear-completed">Clear completed</button>
  </footer>
</section>
<footer class="info">
  <p>Double-click to edit a todo</p>
  <!-- Remove the below line ↓ -->
  <p>Template by <a href="http://sindresorhus.com">Sindre Sorhus</a></p>
  <!-- Change this out with your name and url ↓ -->
  <p>Created by <a href="http://todomvc.com">you</a></p>
  <p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>

安装模板依赖的样式文件:

npm install todomvc-app-css

todomvc-angular\src\styles.css 文件中导入样式文件:

/* You can add global styles to this file, and also import other style files */
@import url('../node_modules/todomvc-app-css/index.css');

看到如下页面说明成功。

基础案例:TodoMVC[通俗易懂]

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/155603.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • windows server2008 R2搭建ftp服务器「建议收藏」

    windows server2008 R2搭建ftp服务器「建议收藏」我们在工作中经常使用到ftp服务器。包括我们的server-u服务器,但是我们的server-u是收费软件,如果公司对软件版权问题比较注重的话,不建议使用server-u,特别是如果公司有安装了server2008的话,我们就可以使用server2008子代的IIS工具来搭建我们的ftp服务器。今天我们就来一步一步搭建我们的ftp服务器。1、环境要求。安装有windowsserver2…

    2022年7月12日
    19
  • element关于table拖拽排序问题

    element关于table拖拽排序问题element关于table拖拽排序问题

    2022年6月16日
    46
  • vue中import作用「建议收藏」

    vue中import作用「建议收藏」html文件中,通过script src = ‘xxx’标签引入js文件。而vue中,通过import xxx from xxx路径 的方式导入文件,不光可以导入js文件。“xxx”指的是为导入的文件起一个名称,不是指导入的文件的名称,相当于变量名。“xxx路径”指的是文件的相对路径.例如:在App.vue中导入index 和 content分别可以写:import…

    2022年6月13日
    46
  • SpringBoot面试题及答案140道(2021年最新)

    SpringBoot面试题及答案140道(2021年最新)工作5年,处于找工作中ing。今年10月份刚刚整理出来的SpringBoot面试题,时间比较赶就没有按照模块分类排序了。总而言之,顺序比较乱,希望大家耐着性子看。如果实在介意,评论告知,我会视情况作修改的。另外如果大家觉得我找的SpringBoot面试题答案不够清晰,欢迎私信或者评论只出,我看到都会去修改的!1、SpringBoot有哪些优点?SpringBoot的优点有:1、减少开发,测试时间和努力。2、使用JavaConfig有助于避免使用XML。3、避免大量的Maven…

    2022年6月7日
    30
  • phcharm激活码(最新序列号破解)

    phcharm激活码(最新序列号破解),https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月20日
    64
  • Android利用网络编程HttpClient批量上传(一个)

    Android利用网络编程HttpClient批量上传(一个)

    2022年1月3日
    36

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号