1.打开终端命令行窗口

2.切换到指定目录

 E:\cd myobject

3.创建新项目

ng new angular2-helloworld

 

4.创建成功后,在angular2-helloworld目录下 运行

ng serve

这个命令会编译项目,并作为web服务器运行,同时还监听项目中的文件变化,实时刷新显示

5.在浏览器中输入http://localhost:4200/,便可看到新创建的项目

6.利用json-server虚拟webapi服务

如在angular2-helloworld目录下 运行 json-server ./src/app/heroes-data.json

 

posted on 2017-11-06 10:00  滴水冰寒  阅读(235)  评论(0编辑  收藏  举报