Angular学习笔记:Angular CLI
2024-10-19 03:35:17
定义
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
最新文章
- 李洪强iOS经典面试题156 - Runtime详解(面试必备)
- Django提交POST表单“CSRF verification failed. Request aborted”问题的解决
- 三角形问题的解决复杂度O(n^3)和O(nlogn)的比较
- ss与udp转发的释疑
- linux 输入子系统(4)---- input子系统的初始化
- Nginx 禁止访问某个目录或文件的设置方法
- Windows Azure中对映像的管理及操作
- HDU 5418 Victor and World (Floyd + 状态压缩DP)
- ComponentName的意思
- c#1所搭建的核心基础之值类型和引用类型
- NuGet的本地服务器安装与Package的发布
- windows 2008 R2操作系统上使用iis服务运行php和mysql数据库的网站遇到的验证码不显示问题?
- Effective Java 第三版——7. 消除过期的对象引用
- Python sqlite3操作笔记
- java重新开始学习
- 【Android端ANR卡顿检测】BlockCanary检测
- NHibernate 数据查询之Linq to NHibernate
- leetcode463
- BZOJ 2738 子矩阵第k大 | 二维树状数组 整体二分 分治
- [Linux]在终端启动程序关闭终端不退出的方法
热门文章
- 生产环境nginx上传文件报错413 Request Entity Too Large
- 15种css居中方式
- laravel5.6上传图片及显示
- Codeforces Round #520 (Div. 2)
- Codeforces Beta Round #49 (Div. 2)
- chrome谷歌浏览器常用快捷键搜集整理
- bootstrap-table 使用遇到的问题总结
- [剑指Offer]34-二叉树中和为某一值的路径
- swift - 加速器/摇一摇功能
- swift -2018 - 创建PCH文件