Angular cli 常用命令

2020/03/30 09:24
阅读数 91

1. 创建项目: ng new

ng new angular-demo

如果只想创建项目,而不安装依赖,可增加--skip-install参数。创建完成后,进入项目目录,执行npm install 或者 cnpm install来手动安装项目依赖。

ng new angular-demo --skip-install

2. 创建组件: ng g component 或者 ng generate component

ng g component components/home
或者
ng generate component components/home

3. 创建服务: ng g service

ng g service home

4. 创建模块: ng g module

ng g module app-routing --flat --module-app

 

 

启动项目: ng server --open

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部