【问题标题】:Removing .Spec file on nativescript angular on component generation在组件生成时删除 nativescript angular 上的 .Spec 文件
【发布时间】:2020-06-06 13:39:45
【问题描述】:

我是 nativescript bot 的新手,对 angular 并不陌生。我现在正在学习带有角度的 nativescript。在 nativescript-NG 项目中生成组件时,我得到了引发语法错误的 .spec 文件。删除它可以解决问题。在所有情况下,我都想在没有 .spec 文件的情况下生成我的组件、服务、模块……。我曾经在角度上使用:

ng configSchematics.@schemics/angular.component.spec false

肯定会为其他人用服务、模块...替换组件。

这在 nativescript-Ng 中没有成功,这是非常正确的,因为 nativescript 使用 @nativescript/schematics 其中 angular 使用 @示意图/角度

我试过了:

ng configSchematics.@nativescript/schematics.component.spec false

没有运气。

我怎样才能实现我的目标?

【问题讨论】:

  • 请仔细阅读我的帖子,不是因为你提到的帖子是角度的。我要的是 Nativescript-Angular。正在使用不同的原理图,所以你提到的帖子(我试过)不起作用:)

标签: angular nativescript angular2-nativescript nativescript-angular


【解决方案1】:

在 nativescript-NG 项目的 angular.json 文件中,添加以下内容:

  "schematics": {
    "@schematics/angular:component": {
    "skipTests": true
  }
 },

现已测试。希望对您有所帮助!

P.S:它适用于任何东西,只需将组件替换为您需要的组件 :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-26
    • 2021-12-13
    • 1970-01-01
    • 2017-05-14
    • 2020-01-28
    • 1970-01-01
    相关资源
    最近更新 更多