1. Angular 环境搭建和项目创建
2019-12-24 本文已影响0人
晨曦Bai
1. 官网
2. 搭建环境
https://angular.io/guide/setup-local
0. Prerequisites
yum nodejs12
(还有其他平台的安装命令)
node -v
-----------------------------------------------
nodejs 官网: https://nodejs.org/en/download/package-manager/
ubuntu/Debian 命令安装nodejs 的方法: https://github.com/nodesource/distributions/blob/master/README.md
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
1. Install the Angular CLI
npm install -g @angular/cli
2. Create a workspace and initial application
ng new my-new-project
3. Run the application
cd my-new-project
ng serve --open
4. Build for production
cd my-new-project
ng build --prod
5. Create a new component/module/service
ng g component xxx
ng g module xxx
ng g service xxx