脚手架安装
npm install -g @angular/cli 安装最新的脚手架
npm install -g @angular/cli@12 安装指定版本的脚手架
镜像包安装
cnpm install -g @angular/cli 安装最新的脚手架
cnpm install -g @angular/cli@12 安装指定版本的脚手架
创建项目
ng new project-name 正常安装
ng new project-name --skip-install 忽略选项安装
npm install
cnpm insatll
npm install -g cnpm --registry=https://registry.npm.taobao.org 淘宝镜像安装
npm install npm -g npm自我更新
ng -v angular-cli版本查看
ng g c hello 快速创建组件 ng generate component <component-name>
目录结构
appname
--e2e 测试文件夹
--node_modules 依赖项
--src
--app
--app-routing.module.ts 路由配置文件
--app.component.html 模版文件
--app.component.spec.ts 测试文件
--app.component.ts 逻辑文件
--app.module.ts 主入口文件
--assets
--environments
--favicon.ico
--index.html 单页面
--main.ts 项目入口
--polyfills.ts
--styles.css 样式表
--test.ts
--tsconfig.json
--browserslistrc 浏览器兼容配置
--editorconfig 编码配置项
--gitignore git忽略项配置
--angular-cli.json angular主配置项
--karma.conf.js 自动化测试配置项
--package-lock.json 锁定项,基于package.json
--protractor.conf.js
--tslint.json
angular 安装记录
最新推荐文章于 2024-08-19 19:55:55 发布