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


相关推荐

  • app怎么修改服务器IP地址,怎么修改手机服务器ip地址

    app怎么修改服务器IP地址,怎么修改手机服务器ip地址怎么修改手机服务器ip地址内容精选换一换如果私钥文件丢失了,可以为服务器替换新的密钥对,并使用新的私钥文件连接云手机。以下为替换服务器密钥对的操作指导,请提前在云服务器控制台创建密钥对,并将密钥对对应的私钥文件下载至本地。登录管理控制台。在服务列表页,选择“计算>云手机CPH”。进入云手机页面。进入云手机页面。单击左侧导航栏的“服务器管理”。选择需要修改密钥对的服务器,在本文主要介绍…

    2022年6月29日
  • PIP 更换国内安装源「建议收藏」

    PIP 更换国内安装源「建议收藏」pip国内的一些镜像  阿里云http://mirrors.aliyun.com/pypi/simple/  中国科技大学https://pypi.mirrors.ustc.edu.cn/simple/  豆瓣(douban)http://pypi.douban.com/simple/  清华大学https://pypi.tuna.tsinghua.edu.cn/simpl…

    2022年6月4日
  • 三星note3怎样刷原生Android,三星note三可以刷原生android系统吗?

    三星note3怎样刷原生Android,三星note三可以刷原生android系统吗?可以的。1刷之前要备份好个人的通讯录等资料。如果你的手机使用正常就不用去刷了。自己刷也是可以的,但要到网上下载手机软件,三星的网上版本多,有些是专为水货编写的。2刷机最好在风险可控前提下的刷机。当前DIY的版本都是基于原版的,只不过是将原来的图片替换成另外的图片,将原来的铃声替换成另外的铃声,没有动核心部分。只是替换更改了部分图片、铃声或者菜单字符等,所以不应该有不良影响,按步骤操作,刷机是基本上…

    2022年6月19日
  • window 下 win10 jdk8安装与环境变量的配置(超级详细)[通俗易懂]

    window 下 win10 jdk8安装与环境变量的配置(超级详细)[通俗易懂]1、jdk的下载1.1官网下载地址https://www.oracle.com/java/technologies/javase-downloads.html这里以为下载需要登录所以我准备了百度网盘1.2百度网盘下载链接:https://pan.baidu.com/s/1uBm0XqBtbdafWgn_YUSWLA提取码:2mqh2、新建文件夹2.1、新建Java文件夹我这里选择的是安装的文件夹我在H盘里面新建了个java文件夹,这里盘符可以改的CDE啥都无所谓

    2022年6月18日
  • vscode新建html文件并快速生成标准的html代码[通俗易懂]

    vscode新建html文件并快速生成标准的html代码[通俗易懂]vscode下载安装:在官网下载vscode最新版本并安装,打开如图所示:步骤一:新建文件将自动生成Untitled-1文本文件步骤二:在打开窗口的文件右小角单击文件类型在弹出来的文件类型里选择html步骤三:在html文件里输入英文感叹号!,然后输入tab键,将自动生成标准的html…

    2022年8月22日
  • SO库版本号管理

    SO库版本号管理编写SO库文件时可以输入版本号调用SO库文件中特定的函数可以输出版本号

    2022年6月17日

发表回复

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

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