Home > Web Front-end > H5 Tutorial > How should I learn Angular2?

How should I learn Angular2?

零下一度
Release: 2017-06-27 10:04:04
Original
1706 people have browsed it

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

#angular cli安装
npm install -g angular-cli
Copy after login

After cli is installed, we can use the instructions starting with ng (just understand it as npm) ), create the project below

#安装相关项目包,具体包package.json里的dependencies和devDependencies有体现
#下面步骤用npm install也可以
ng init
Copy after login

After the package is installed, we can start our project. After execution, we can open

in http://localhost:4200
#下面步骤用npm start也可以
ng serve
Copy after login

If you want to open multiple projects for colleagues, you can modify the project port number

#修改默认端口4200 -> 修改为(3000) 
ng serve --port 3000 
或 ng serve -p 3000
Copy after login

There is also a method to modify the project port but it is not recommended

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

Last package release

ng build
Copy after login

The above is the detailed content of How should I learn Angular2?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template