Skip to content

Angular2实例,angular-in-memory-web-api,官网案例

Notifications You must be signed in to change notification settings

ReySun/ng2-hero-webapi

Repository files navigation

HeroWebapi

This project was generated with angular2中文网 version 1.0.0-beta.28.3.

安装包依赖

防qiang,你懂的!

npm install -g cnpm 
cnpm install

special

相较于上个案例ng2-hero-mock,多安装了npm包:angular-in-memory-web-api,能够使用客户端模拟服务器数据

cnpm install angular-in-memory-web-api --save--dev

启动应用

默认启动localhost:4200

npm start

如果端口被占用,可以使用ng serve命令换端口号,例如:

ng serve --port=4000