准备
- win7 64位环境,根据电脑系统选择安装相应的Node.js和Git
- 安装完成后,在cmd中输入node -v和npm -v查看版本信息。
步骤
1.打开Git Bash 从 github获取AngularJS应用phonecat
git clone git://github.com/angular/angular-phonecat.git
该命令路径为当前文件夹
2.进入angular-phonecat目录,重置项目
git checkout -f step-0
该命令重置phonecat项目的工作目录,目录中的数字与学习步骤数字相对应
3.启动服务器
npm start
该命令会运行bower安装项目所需要的通用依赖库
4.打开浏览器
Starting up http-server, serving ./ on port: 8000
git-bash如上提示时表示服务器运行成功,在浏览器中输入http://localhost:8000/app/index.html来访问我们的phonecat应用
学习练习AngularJS入门教程00:引导程序的其他部分。