avatar
童琦杰
Jun 1, 2019Technology

Angular - 开发指南

更新Angular CLI

npm uninstall -g angular-cli
npm cache verify
sudo npm install -g @angular/cli@latest

使用ng version查看当前安装的版本

更新Angular

ng update @angular/core

创建项目

创建Angular项目目录

ng new angular-apps --createApplication=false --minimal=true

创建Angular应用

ng generate application app-name --minimal=true

创建Component

ng generate component component-name --module app

编译项目

ng build app-name --baseHref="/" --prod=true --outputPath="./dist/app-name"

服务端渲染

ng add @nguniversal/express-engine --client-project='app-name'
© 2015-2022 tongqijie.com 版权所有沪ICP备17000682号