2015년 7월 2일 목요일

angularjs development environment

0. description
command : need to type command  from shell
files : represent source files or related files in specific location

1. install node.js
You can install node.js from https://nodejs.org/.

2. install connect, serve-static
$ npm install connect
$ npm install serve-static

3. create server.js
make nodejs dir(any directory is ok). Refer following directory structure which i used.
|____
| |____angularjs
| | |____angular-animate.js
| | |____angular-mocks.js
| | |____angular-route.js
| | |____angular-sanitize.js
| | |____angular-touch.js
| | |____angular.js
| | |____bootstrap-theme.css
| | |____bootstrap.css
| | |____test.html
| |____nodejs
| | |____server.js

The important thing is the line 4. You should set correct path which contains angularjs app.
nodejs/server.js
4. install karma
$ npm install -g karma

5. download AngularJS
https://www.angularjs.org/

6. make angularjs directory and copy files. The directory should be set from server.js
angularjs/angular-animate.js
angularjs/angular-mocks.js
angularjs/angular-route.js
angularjs/angular-sanitize.js
angularjs/angular-touch.js
angularjs/angular.js

7. download bootstrap
http://getbootstrap.com/
copy css file to angularjs directory
angularjs/bootstrap-theme.css
angularjs/bootstrap.css

8. create test.html file in angularjs directory
angularjs/test.html

9. move to nodejs directory and run following command
$ node server.js

10. open browser and go to http//localhost:5000/test.html



댓글 없음:

댓글 쓰기