- Use Yeoman to produce Angularjs's main skeleton
- Accelerate development and help execution with grunt
- Use Bower to add third-party plugins and frameworks to--third parties Plugins/frameworks
First, the preparatory work
Install Nodejs and NPM (readers can go to Google by themselves)
Second, install Yeoman, Grunt and Bower, produce the main skeleton of Angularjs
2.1 Create a new directory and enter the directory to perform
npm install -g yo grunt-cli bower
At this time Yeoman,grunt and Bower are installed once, Description:-G indicates that the global installation
2.2 Execution
npm install -g generator-angular
安装AngularJS generator
产生AngularJS application的文件框架脚手架(scaffolding)
此时你的目录中就已经有了一个静态的AngularJS App的基本框架文件了
package.j
All dependencies of son--management project
G
runtfile.js--tasks and plugins required to configure the project
- component.json--Dependencies Notify Bower Package Manager of your project, named Bower.json in the latest Bower version
.bowerrc —— 将你工程所用的配置选项通知Bower
- test--is using the Karma test.
Open .bowerrc
the file and join--tell Bower to install the package by Bower.json definition
{ "directory": "App/components", // Addthis line }
Install angular ui--with bower to install the library as you need it
bower install angular-bootstrap --save
Description
Second, modify the Angularjs, develop the app
2.1 Open the App directory
Where Bower_components is the module that needs to be installed in Bower.json
2.2 Execution
grunt serve
Grunt automatically executes JavaScript, including auto-compiling coffeescript, compressing minifying CSS, compiling sass for CSS, code validation, and so on.
Description: I always make mistakes in this step: Grunt Fatal error:listen eacces, continue to study ...
2.3 Testing
grunt test
Reference: http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/