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> ...
随机推荐
- python调用修改变量新方法
def foo(): count = [1] #将变量放在列表中,此时,内部函数就可以修改了 def bar(): count[0] = count[0] + 1 return count[0] re ...
- uva11610 树状数组+素数打表求因子,好题!
/* uva11610 树状数组+素数打表+离散化 打出的素数范围在2-1000000之间,不超过六位数,然后按照格式翻转成七位数 */ #include<bits/stdc++.h> u ...
- spoj New Distinct Substrings
vjudge原地爆炸... 题意:求一个字符串不同的子串的个数 策略:后缀数组 利用后缀数组的sa和height两个功能强大的数组,我们可以实现上述操作 首先有个很显然的结论:一个字符串的所有子串=它 ...
- Kotlin 喧嚣过后,谈谈 Java 程序员未来的出路
http://blog.jobbole.com/111422 Java 生态圈 Java 的生态环境开放.自由,在Sun/Oracle.Google.Apache.Eclipse基金会等各大厂商,还有 ...
- Oracle回收站的清理方法
http://blog.itpub.net/18841027/viewspace-1057765/
- 【BZOJ 3294】[Cqoi2011]放棋子
题解: 一道很经典的组合数+dp 首先考虑f[i][j][k]表示前k种颜色正好占据了i行j列 转移的话就是枚举第k种颜色占据了几行几列 通过自身转移 然后其在内部的相对顺序是不确定的所以要乘以组合数 ...
- 关于tomcat性能优化
前言 关于 Tomcat 性能调优,一直以来就是运维面试的一个重要话题.今天我们就简单聊聊 Tomcat 如何进行性能优化? 首先声明,我不会去说 Tomcat 是什么,内部结构,原理什么的.我不懂. ...
- 安装elasticsearch-7.0.0及插件
下载安装包:(下载地址:https://www.elastic.co/cn/downloads/elasticsearch)elasticsearch-7.0.0-linux-x86_64.tar.g ...
- 035 HDFS的联盟Federation
一:概述 1.单个namenode的局限性 namespace的限制 单个namenode所能存储的对象受到JVM中的heap size的限制 namenode的扩张性 不可以水平扩张 隔离性 单个n ...
- 浮点数在计算机中的表示(IEEE浮点数标准)
转载自:https://wdxtub.com/2016/04/16/thin-csapp-1/