该项目是[Pro Angular2]书中的演示项目,我又手动实现了一遍。项目初始化时采用了Angular CLI脚手架。
前端服务器会允许在4200端口上,使用npm run serve
后启动。后台数据我采用了json-server
库来实现,因此需要先运行npm run json
后启动该后台服务器,该服务器允许在3500端口上,用于mock数据。
在命令行中输入npm run start
会同时启动服务端和客户端,你也可以分别启动npm run serve
和npm run json
。然后访问http://localhost:4200
。
Run npm run bundle
to build the project, which will use the rollup to bundle.
使用npm run bundle
去打包项目,采用rollup来去除冗余代码。
首页
用户认证页
用户管理页