基础案例: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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • maven学习系列——(三)maven项目的创建

    这一篇大概会整理和总结到有如下知识点: (1):maven的使用入门一些命令 (2):用命令创建项目 (3):使用IDE集成工具创建项目–Eclipse和idea

    2022年2月25日
    42
  • IDDR和ODDR使用

    IDDR和ODDR原语是针对7系列芯片使用,spand可以使用IDDR2和ODDR2IDDR三种模式OPPOSITE_EDGEMode传统的输入DDR解决方案或OPPOSITE_EDGE模式是通过ILOGIC模块中的单个输入实现的。数据在时钟的上升沿通过输出Q1提供给FPGA逻辑,在时钟的下降沿通过输出Q2提供给FPGA逻辑。该结构类似于Virtex-6FPGA实现。图1显示…

    2022年4月7日
    121
  • ideal 激活码查看【在线注册码/序列号/破解码】

    ideal 激活码查看【在线注册码/序列号/破解码】,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月20日
    59
  • Python爬虫常用:谷歌浏览器驱动——Chromedriver 插件安装教程

    Python爬虫常用:谷歌浏览器驱动——Chromedriver 插件安装教程我们在做爬虫的时候经常要使用谷歌浏览器驱动,今天分享下这个Chromedriver插件的安装方法。第一步、打开谷歌浏览器打开设置面板第二步、查看当前谷歌浏览器版本号第三步、点击插件下载,进去这个界面,找到跟自己谷歌浏览器版本号最相近的那一个。下载地址:插件下载这里有许多的版本,注意icons/向下的版本是无用的。选择icons/以上的版本,越靠近icons/的版本越新。第四步、找到对应版本后点击它计进入这个页面,点击notes.txt查看与Chrome版本是否对应。第五步、回

    2022年5月11日
    62
  • csdn博客排名前100_博主推荐

    csdn博客排名前100_博主推荐推荐CSDN排名前1000博主https://blog.csdn.net/ZYC88888/article/details/98479146?utm_medium=distribute.pc_relevant_bbs_down.none-task–2~all~first_rank_v2~rank_v29-23.nonecase&depth_1-utm_source=distribute.pc_relevant_bbs_down.none-task–2~all~first_rank_v2…

    2022年9月26日
    3
  • UML——行为图

    UML——行为图UML——行为图

    2022年4月24日
    56

发表回复

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

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