【问题标题】:error TS5023: Unknown compiler option 'strictTemplates'错误 TS5023:未知的编译器选项“strictTemplates”
【发布时间】:2021-06-09 09:33:20
【问题描述】:

编译 Angular 应用程序 (v10) 失败并出现此错误。

An unhandled exception occurred: tsconfig.json:14:5 - error TS5023: Unknown compiler option 'strictTemplates'.

14     "strictTemplates": true,
       ~~~~~~~~~~~~~~~~~

【问题讨论】:

    标签: angular typescript ivy tsconfig


    【解决方案1】:

    strictTemplates 是 Angular 编译器的参数。

    在您的 tsconfig.json 中:将参数移到 angularCompilerOptions

    "angularCompilerOptions": {
      ...,
      "strictTemplates": true,
      ...
    }
    

    Angular >= 9 是必需的。

    更多信息在这里:https://angular.io/guide/template-typecheck

    【讨论】:

      猜你喜欢
      • 2018-07-25
      • 2019-02-19
      • 1970-01-01
      • 1970-01-01
      • 2021-12-29
      • 2018-05-27
      • 2021-07-14
      • 2023-02-16
      • 2019-10-07
      相关资源
      最近更新 更多