Angular2 getting started, angular2 getting started

Source: Internet
Author: User

Angular2 getting started, angular2 getting started

Recently, versions of angular2, 1, and 2 have changed significantly. The following summarizes some learning websites and installation steps.

 

Official Chinese website (required ):

Https://angular.cn

Lazy learning:

Http://www.imooc.com/learn/789

Support for bootstrap UI Components

Https://github.com/angular-ui/bootstrap

Miss desert masterpiece (with video source code ):

Http://git.oschina.net/mumu-osc/NiceFish

 

To install the environment, first install cli. Remember to install it globally.

# Installing angular cli
Npm install-g angular-cli

 

After the cli is installed, we can use commands starting with ng (just as npm can understand). The following creates a project

# Cmd go to the project directory and create the project ng new project_name # Go To The project directory cd project_name
# Install the relevant project packages. The dependencies and devDependencies in the package. json package are reflected in
# The following steps can also be performed using npm install
Ng init

After the package is installed, you can start our project. After the package is executed, we can open it in http: // localhost: 4200.

# Start a project
# The following steps can also be performed using npm start
Ng serve

To open multiple projects, you can modify the project port number.

# Modify the default port 4200-> to (3000)
Ng serve -- port 3000
Or ng serve-p 3000

There is another way to modify the project port, but it is not recommended.

Project directory \ node_modules \ angular-cli \ lib \ config \ schema. json
# Change "default": 4200 to "default": 3000 in serve

Final package release

ng build

 

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.