【问题标题】:Display typescript error in html in Intellij/Webstorm在 Intellij/Webstorm 中的 html 中显示 typescript 错误
【发布时间】:2021-01-12 01:01:59
【问题描述】:

是否可以设置 Intellij 在 Angular 模板中显示 TypeScript 错误?我在stackblitz 上共享了以下虚拟应用程序。如果我创建一个带有可选对象参数的@Input 并在模板中使用它,我会在控制台中遇到错误,但 Intellij 可以。没有任何错误。注意,我有严格模式:

tsconfig.json

"angularCompilerOptions": {
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true
}

data.ts

export interface Data {
  id?: number;
  title?: string;
}

data.component.ts

@Component({
  selector: 'app-data',
  templateUrl: './data.component.html',
})
export class DataComponent {
  @Input()
  public data?: Data;
}

data.component.html

<p>{{data.title}}</p>

终端输出

模板在 Intellij 中打开

【问题讨论】:

    标签: typescript intellij-idea


    【解决方案1】:

    目前无法执行此操作,请投票给WEB-49062 以获取有关此功能的任何进展的通知

    【讨论】:

      猜你喜欢
      • 2021-04-08
      • 1970-01-01
      • 2013-08-03
      • 2017-01-16
      • 2020-03-30
      • 2017-04-03
      • 1970-01-01
      • 2018-07-05
      • 1970-01-01
      相关资源
      最近更新 更多