在 Angular 5 及早期版本中,为了停止在生成组件时生成规范文件,我们需要在 .angular-cli.json 文件中添加以下内容:
但是,即使在IDE重新启动后生成新组件,仍然会创建一个新的规范文件,缺少什么?
{
...
"defaults": {
"spec": {
"class": false,
"component": false,
"directive": false,
"module": false,
"pipe": false,
"service": false
}
}
}
在Angular 6+中,根据此链接,我们需要在新的angular.json文件中,在schematics部分下添加以下内容:
....
"schematics": {
"@schematics/angular:component": {
....
"properties": {
....
"spec": {
"type": "boolean",
"description": "Specifies if a spec file is generated.",
"default": false
}
}
}
},
但是,即使在IDE重新启动后生成新组件,仍然会创建一个新的规范文件,缺少什么?