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