ANGULAR2 Environment Configuration Detailed introduction _angularjs

Source: Internet
Author: User
Tags small web server

See angular released the official version, echocardiography ready to test under.

Looking at the official website tutorial, using the CLI to create the project, type at the command line:

Installing CLI

NPM install-g ANGULAR-CLI

If you have installed a previous version, perform the following command to update:

NPM uninstall-g ANGULAR-CLI
NPM Cache Clean
NPM install-g Angular-cli@latest

Older versions of the CLI used SYSTEMJS and the most recent creation, based on Webpack builds.

Older versions of ANGULAR2 (RC1-RC6) can view update steps

The interesting thing here is that after I uninstall ANGULAR-CLI, a build failed error occurred at the time of installation and finally found the reason that uninstall was not uninstalled cleanly. Go to the global directory to delete the relevant NG files.

Common ng Command

ng New Project-name-Create a new project, set as default
NG Build-building/compiling applications
NG Test-run unit tests
Ng e2e-run end-to-end (end-to-end) test
Ng serve-Launches a small Web server for managed applications
Ng deploy-is available, deployed to GitHub pages or firebase
Ng generate component My-comp-generates a new component that generates its test specifications and corresponding HTML/CSS files
ng generate directive my-directive-generate a new instruction
ng generate pipe my-pipe-Generate a new pipeline
Ng Generate service My-service-Generate a new one
ng generate route My-route-Generate a new route
Ng generate class My-class-generates a simple model class

Create a project

Use NG new Project-name to create the project, and after the creation is complete, be patient for a while after the Nodejs module is needed.

Warning Error

In the use of wing, a problem has been encountered and the class has been warned. See the hint to set the "Experimentaldecorators" property. The final modification of the two solutions.

Add in Tsconfig.json:

"Emitdecoratormetadata": true,
"Experimentaldecorators": true,

Add in Setting.json:

"TYPESCRIPT.TSDK": "Node_modules\\typescript\\lib"

The above is the Angular2 of environmental configuration to do the data collation, follow-up to continue to supplement the relevant information, thank you for your support of this site!

Related Article

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.