angular default project (angular.json的解读)
Change the default Angular project
Understanding it's purpose and limits

Angular's default project is nothing more than a string, set in angular.json, to say which project should run with ng commands without a defined project.
Note: The defaultProject key was set to be deprecated in 7.0.0 , but it was blocked because there should be a large discussion about project layout for 8.x.x.
Let's create a new project called my-app:
$ ng new my-app
It will create an angular.json with the following structure:
{
...,
"projects": {
"my-app": { ... },
"my-app-e2e": { ... },
},
"defaultProject": "my-app",
}
So, when you run ng serve , it would serve my-app. It would be the same as running ng serve my-app.
Setting a new default project
To understand what values are valid, let's create a library and an application.
$ ng create application my-application
$ ng create library my-library
Now, we have the following structure:
{
...,
"projects": {
"my-app": { ... },
"my-app-e2e": { ... },
"my-application": { ... },
"my-application-e2e": { ... },
"my-library": { ... }
},
"defaultProject": "my-app",
}
The highlighted values ( my-app, my-application and my-library) are the valid ones to use as the defaultProject. E2E projects are not valid ones, even if they are listed as projects, because they are used on ng e2e.
If you created a blank workspace or just deleted the default project string, the first project you create (in this case
my-application) will automatically be set as the default project.
Commands
Each project type has their own commands to use, for example:
Applications: serve, build, test, e2e and xi18n.
Libraries: build and test.
This article is part of a collection of tips for managing Angular workspaces.
angular default project (angular.json的解读)的更多相关文章
- [转]How to Add Bootstrap to an Angular CLI project
本文转自:https://loiane.com/2017/08/how-to-add-bootstrap-to-an-angular-cli-project/ In this article we w ...
- Angular 2 to Angular 4 with Angular Material UI Components
Download Source - 955.2 KB Content Part 1: Angular2 Setup in Visual Studio 2017, Basic CRUD applicat ...
- AngularJs angular.uppercase、angular.lowercase、angular.fromJson、angular.toJson
angular.uppercase 将指定的字符串转换成大写 格式:angular.uppercase(string); string:被转换成大写的字符串. 使用代码: var str = &quo ...
- Angular - - angular.uppercase、angular.lowercase、angular.fromJson、angular.toJson
angular.uppercase 将指定的字符串转换成大写 格式:angular.uppercase(string); string:被转换成大写的字符串. 使用代码: var str = &quo ...
- 使用Angular CLI生成 Angular 5项目
如果您正在使用angular, 但是没有好好利用angular cli的话, 那么可以看看本文. Angular CLI 官网: https://github.com/angular/angular- ...
- Angular 学习笔记 (Angular 9 & ivy)
refer : https://blog.angularindepth.com/all-you-need-to-know-about-ivy-the-new-angular-engine-9cde47 ...
- Angular 1与 Angular 2之间的一些差别
现在在用ng1.5.8做一个项目,ng的优点和特性我就不用多说了,ng1在陆续更新到1.5/1.6后就没再推出新版本了,ng2已经面世测试很久了,如同很多系统和框架一样,每个大的版本更新都会有新特性加 ...
- AngularJs angular.injector、angular.module
angular.injector 创建一个injector对象, 调用injector对象的方法可用于获取服务以及依赖注入. 格式:angular.injector(modules); modules ...
- angular.js 的angular.copy 、 angular.extend 、 angular.merge
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
随机推荐
- Date对象和Time对象
方法 描述 getDate() : setDate() 返回/设置月份中的日期(1-31) getDay() 返回星期几(0-6) getFullYear():setFullYear() ...
- 《剑指offer》-旋转数组的最小数字
把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转. 输入一个非递减排序的数组的一个旋转,输出旋转数组的最小元素. 例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数 ...
- 查看Linux端口的占用及连接情况
[root@cloudplatform ~]# netstat -nap | grep 22066 | grep 127.0.0.1 -vtcp 0 0 :::22066 ...
- 查看Windows系统里的进程已运行的时间
搜索 ProcessExplorer ,可以去微软下载它.右键点击项类,selcet conlumns...在 Process Performance 里 选择start time.有了进程的启动时间 ...
- Python hashlib、hmac加密模块
#用于加密的相关操作,3.x里代替了md5模块和sha模块,主要提供sha1,sha224,sha256,sha384,sha512,md5算法 #sha2为主流加密算法,md5加密方式不如sha2 ...
- HDU 2089 不要62 【数位dp】
<题目链接> 不要62 Problem Description 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer).杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照 ...
- 我的Java自学之路
其实在转正之后我就想抽个时间好好的梳理一下我的 Java 上车之路 ,但是一直拖到现在 ,因为有学弟问到 ,所以也就给了我动力 .毕竟答应了人家的事要做到 . 首先要有相应的背景介绍 ,不然说个毛线啊 ...
- SQLite中SELECT基本形式
SQLite中SELECT基本形式 每个数据库通常都包含多个表,而每个表又包含多条数据.要获取数据库中的数据,就需要SQL语言提供的查询语句SELECT.本章将讲解和SELECT语句相关的内容,其中包 ...
- 爬虫三Scrapy
Scrapy,Python开发的一个快速,高层次的屏幕抓取和web抓取框架,用于抓取web站点并从页面中提取结构化的数据.Scrapy用途广泛,可以用于数据挖掘.监测和自动化测试. Scrapy吸引人 ...
- FastDFS_v4.06安装简记
提前准备所需4个包:FastDFS_v4.06.tar.gzfastdfs-nginx-module_v1.16.tar.gzlibevent-2.0.20-stable.tar.gznginx-1. ...