起步

下载模板:

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');

看到如下页面说明成功。

最新文章

  1. Wpf 中的DataGrid的Header属性,动态bind时不起作用
  2. run方法和start方法的不同
  3. 使用Visual Assistant X创建C程序注释模板
  4. 傅里叶变换:MP3、JPEG和Siri背后的数学
  5. 在Windows 7上安装MongoDB 2.6.7
  6. linux mysql添加用户
  7. VSTO 得到Office文档的选中内容(Word、Excel、PPT、Outlook)
  8. hdu1506——Largest Rectangle in a Histogram
  9. easyui 个人使用心得之下拉列表
  10. AES加密解密算法---java
  11. 初始Oracle
  12. python修改文件中字符串并写入
  13. python3实现感知器,简单神经网络
  14. LCA 最近公共祖先 (模板)
  15. CSS sprites
  16. Python 字典(联合内存、联合数组)
  17. Linux环境下安装Redis并完成测试(已验证)
  18. 斐波那契数列(Java实现)
  19. 各种数据库对应的jar包、驱动类名和URL格式
  20. 笔记:加密 RSA AES

热门文章

  1. [Effective Java 读书笔记] 第三章 对所有对象都通用的方法 第十---十一条
  2. VFP控制Excel操作集
  3. hive on spark 编译时遇到的问题
  4. Cacti 邮件 报警
  5. 向C++之父Bjarne Stroustrup致敬
  6. -bash: warning: setlocale: LC_CTYPE: cannot change locale (zh_CN.UTF-8mb4): No such file or directory
  7. Go语言SQL注入和防注入
  8. JavaScript将数组转换为链表
  9. Maven 父子工程的一些细节
  10. java开发病房管理系统