1-起步

1、typescript

在使用typescript首先安装node.js

安装typescript:npm install -g typescript

2、angular-cli

安装angular-cli:npm install -g @angular/cli

angular-cli监听文件系统变化是使用watchman工具监听的所以要安装watchman

安装watchman: brew install watchman

3、实例项目

打开终端 并运行 ng new  angular2-hello-world创建一个项目

注:ng-set -global packageManager=cnpm 设置cnpm

4、打开src下的index.html

<app-root>Loading...</app-root>
文本loading。。。是一个站位符在应用代码加载之前会显示它,我们可以借助此技巧来通知用户该应用正在加载,也可以显示一个加载动画或其他形式的进度通知
 
5、运行项目
ng serve
应用在localhost:4200端口运行
 
 

 

posted @ 2017-12-25 10:38  张书达  阅读(374)  评论(0编辑  收藏  举报