Development of Angularjs using Yeoman,grunt and Bower (translated)

Source: Internet
Author: User

    • 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.jAll dependencies of son--management project
    • Gruntfile.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
    • --save indicates that the library is added to the Bower.json configuration file
    • In my operation, how to modify the. BOWERRC, this step will be an error, it is possible that the old version must be modified??????
    • If the bower:enogit git is isn't installed or not in the path error, you need to configure your git to path, as follows
    • If your git installation directory is "C:\Program Files (x86) \git", add Git's bin and cmd directories in path, such as C:\Program files (x86) \git\bin; C:\Program Files (x86) \git\cmd

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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.