我正在阅读angular-cli源代码,并遇到schema.json,它同时具有$default
和default
字段的某些属性,例如
"project": {
"type": "string",
"description": "The name of the project.",
"$default": {
"$source": "projectName"
}
},
"inlineStyle": {
"description": "When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.",
"type": "boolean",
"default": false,
"alias": "s"
}
那么在每个属性中使用$default
和default
的目的是什么? $default
是对象,default
是基本类型吗?还是其他原因?