“Tech:PhoneCat入门”的版本间的差异

来自AboveCloud
跳转至: 导航搜索
开始之前
Chapter 0 - Bootstrapping
 
第40行: 第40行:
  
 
==Chapter 0 - Bootstrapping==
 
==Chapter 0 - Bootstrapping==
 +
 +
angular-seed project
 +
 +
https://github.com/angular/angular-seed
 +
 +
这是一个空的angular项目,专门给各个项目做模板的。
 +
 
==Chapter 1 - Static Template==
 
==Chapter 1 - Static Template==
 
==Chapter 2 - Angular Templates==
 
==Chapter 2 - Angular Templates==

2015年12月16日 (三) 15:27的最新版本

https://code.angularjs.org/1.4.8/docs/tutorial

Phonecat是angularJS入门的一个教程。

开始之前

先吐槽一下:他这个教程的名字很有歧义,我看了标题觉得很晕,我要看angularJS教程,怎么进入到Phonecat了?这是个软件吗?还是个啥?

吐槽完毕,继续学习。之前为了着急做项目,其实所有的文档、教程看得不细致,特别是关于测试的部分直接掠过,这次决定还是要按部就班走一下的。

  • Create a dynamic application that works in all modern browsers.
  • Use data binding to wire up your data model to your views.
  • Create and run unit tests, with Karma.
  • Create and run end to end tests, with Protractor.
  • Move application logic out of the template and into Controllers.
  • Get data from a server using Angular services.
  • Apply animations to your application, using ngAnimate.
  • Identify resources for learning more about AngularJS.


根据教程先get代码

git clone --depth=14 https://github.com/angular/angular-phonecat.git

--depth=14表示只取最近14次的提交,避免文件过大。

在phonecat目录中安装所需的软件包。

npm-install

这个命令会安装大量的软件包,一通下载之后,phonecat/node_modules目录下面已经66.3 MB (69,538,996 字节)了。同情一下小白用户。

然后尝试用 npm start启动测试服务器,用npm run protractor,看到浏览器里一通噼里啪啦,很高大上的样子。看来这个端到端的测试( end to end ,E2E) 很赞啊!

为了跑karma,还要安装Firefox,各种安装中。。。


It is very common to run End to End tests before pushing a new commit of changes to a remote repository.

通常在提交一个版本之前,应该执行端到端(e2e)测试。

Chapter 0 - Bootstrapping

angular-seed project

https://github.com/angular/angular-seed

这是一个空的angular项目,专门给各个项目做模板的。

Chapter 1 - Static Template

Chapter 2 - Angular Templates

Chapter 3 - Filtering Repeaters

Chapter 4 - Two-way Data Binding

Chapter 5 - XHRs & Dependency Injection

Chapter 6 - Templating Links & Images

Chapter 7 - Routing & Multiple Views

Chapter 8 - More Templating

Chapter 9 - Filters

Chapter 10 - Event Handlers

Chapter 11 - REST and Custom Services

Chapter 12 - Applying Animations

Chapter The End