定义

Angular CLI:The Angular CLI is a command line interface tool that can create a project, add files, and perform a variety of ongoing development tasks such as testing, bunding, and deployment.

总而言之,Angular CLI是一款功能很多的命令行工具。

环境

首先要安装Node.js和npm

然后使用如下命令全局安装Angular CLI  npm install -g @angular/cli

常用命令

创建一个名为my-app的项目

ng new my-app

启动项目(需在项目录下,其中 --open 选项会自动打开你的浏览器http://localhost:4200)

ng serve --open

创建一个名为heroes的组件

ng generate component heroes

创建一个名为hero的service

ng generate service hero

创建一个路由模块,其中 --flat 选项会将文件放在src/app文件夹下,其中 --module=app 会告诉CLI在AppModule的imports数组中注册它

ng generate module app-routing --flat --module=app

最新文章

  1. 李洪强iOS经典面试题156 - Runtime详解(面试必备)
  2. Django提交POST表单“CSRF verification failed. Request aborted”问题的解决
  3. 三角形问题的解决复杂度O(n^3)和O(nlogn)的比较
  4. ss与udp转发的释疑
  5. linux 输入子系统(4)---- input子系统的初始化
  6. Nginx 禁止访问某个目录或文件的设置方法
  7. Windows Azure中对映像的管理及操作
  8. HDU 5418 Victor and World (Floyd + 状态压缩DP)
  9. ComponentName的意思
  10. c#1所搭建的核心基础之值类型和引用类型
  11. NuGet的本地服务器安装与Package的发布
  12. windows 2008 R2操作系统上使用iis服务运行php和mysql数据库的网站遇到的验证码不显示问题?
  13. Effective Java 第三版——7. 消除过期的对象引用
  14. Python sqlite3操作笔记
  15. java重新开始学习
  16. 【Android端ANR卡顿检测】BlockCanary检测
  17. NHibernate 数据查询之Linq to NHibernate
  18. leetcode463
  19. BZOJ 2738 子矩阵第k大 | 二维树状数组 整体二分 分治
  20. [Linux]在终端启动程序关闭终端不退出的方法

热门文章

  1. 生产环境nginx上传文件报错413 Request Entity Too Large
  2. 15种css居中方式
  3. laravel5.6上传图片及显示
  4. Codeforces Round #520 (Div. 2)
  5. Codeforces Beta Round #49 (Div. 2)
  6. chrome谷歌浏览器常用快捷键搜集整理
  7. bootstrap-table 使用遇到的问题总结
  8. [剑指Offer]34-二叉树中和为某一值的路径
  9. swift - 加速器/摇一摇功能
  10. swift -2018 - 创建PCH文件