Angular学习笔记:Angular CLI
定义
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
Angular学习笔记:Angular CLI的更多相关文章
- Angular 学习笔记 (Angular 9 & ivy)
refer : https://blog.angularindepth.com/all-you-need-to-know-about-ivy-the-new-angular-engine-9cde47 ...
- angular学习笔记-angular中怎么获取dom元素
步骤分解: 第一步:给要获取的元素一个ng-model变量,并且绑定事件啦! <div class="home" ng-model="dirName" n ...
- angular学习笔记(三十一)-$location(2)
之前已经介绍了$location服务的基本用法:angular学习笔记(三十一)-$location(1). 这篇是上一篇的进阶,介绍$location的配置,兼容各版本浏览器,等. *注意,这里介绍 ...
- angular学习笔记(三十一)-$location(1)
本篇介绍angular中的$location服务的基本用法,下一篇介绍它的复杂的用法. $location服务的主要作用是用于获取当前url以及改变当前的url,并且存入历史记录. 一. 获取url的 ...
- angular学习笔记(三十)-指令(10)-require和controller
本篇介绍指令的最后两个属性,require和controller 当一个指令需要和父元素指令进行通信的时候,它们就会用到这两个属性,什么意思还是要看栗子: html: <outer‐direct ...
- angular学习笔记(三十)-指令(7)-compile和link(2)
继续上一篇:angular学习笔记(三十)-指令(7)-compile和link(1) 上一篇讲了compile函数的基本概念,接下来详细讲解compile和link的执行顺序. 看一段三个指令嵌套的 ...
- angular学习笔记(三十)-指令(7)-compile和link(1)
这篇主要讲解指令中的compile,以及它和link的微妙的关系. link函数在之前已经讲过了,而compile函数,它和link函数是不能共存的,如果定义了compile属性又定义link属性,那 ...
- angular学习笔记(三十)-指令(6)-transclude()方法(又称linker()方法)-模拟ng-repeat指令
在angular学习笔记(三十)-指令(4)-transclude文章的末尾提到了,如果在指令中需要反复使用被嵌套的那一坨,需要使用transclude()方法. 在angular学习笔记(三十)-指 ...
- angular学习笔记(三十)-指令(5)-link
这篇主要介绍angular指令中的link属性: link:function(scope,iEle,iAttrs,ctrl,linker){ .... } link属性值为一个函数,这个函数有五个参数 ...
- angular学习笔记(三十)-指令(2)-restrice,replace,template
本篇主要讲解指令中的 restrict属性, replace属性, template属性 这三个属性 一. restrict: 字符串.定义指令在视图中的使用方式,一共有四种使用方式: 1. 元素: ...
随机推荐
- db2start提示SQL5043,关闭连接终端tty
db2 V10.3启动的时候提示: 问题1: db2start执行后提示: SQL1072C The database manager resources are in an inconsisten ...
- 二、Adapter 适配器
适配器:继承适配与委托适配 需求:Banner 可以输出强电流380v.弱电流12v,但是不能被直接使用.通过别的方式,介间的使用banner? 委托类图: 代码清单: 需要隐藏的功能类: publi ...
- tomact启动报错org.apache.jasper.EmbeddedServletOptions.<init> The scratchDir you specified:xxx is unusable.
问题: 22-May-2018 18:00:15.891 严重 [localhost-startStop-1] org.apache.jasper.EmbeddedServletOptions.< ...
- spring boot 启动错误:Could not resolve placeholder
在启动整个spring boot项目时,出现错误: Could not resolve placeholder 原因:没有指定好配置文件,因为src/main/resources下有多个配置文件,例如 ...
- centos 7 redis-4.0.11 主从
redis-master:192.168.199.223 redis-slave: 192.168.199.224 cd /opt wget http://download.redis.io/rele ...
- Fiddler调试和Wireshark数据包分析
扫码时备注或说明中留下邮箱 付款后如未回复请至https://shop135452397.taobao.com/ 联系店主
- RocketMQ-quickstart(批量消费)
一.专业术语 Producer 消费生产者,负责产生消息,一般由业务系统负责产生消息 Consumer 消息消费者,负责消费消息,一般是后台系统负责异步消费 Push Consumer Consume ...
- mysql学习2:模糊匹配查询like,regexp,in
mysql模糊匹配查询like,regexp,in 摘要 内容比较简单,无摘要. 关键词 模糊查询 like regexp in contact 正文 下图是示例用到的数据表信息 ...
- SQL SERVER数据库性能优化之SQL语句篇
(引用自重明鸟的博客,方便学习和查看) 1. 按需索取字段,跟“SELECT *”说拜拜 字段的提取一定要按照“用多少提多少”的原则,避免使用“SELECT *”这样的操作.做了这样一个实验,表tbl ...
- webpack.prod.conf.js
// 引入依赖模块 var path = require('path') var utils = require('./utils') var webpack = require('webpack') ...