在Intellij/Webstorm中的html中显示打字稿错误 [英] Display typescript error in html in Intellij/Webstorm

查看:54
本文介绍了在Intellij/Webstorm中的html中显示打字稿错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以设置Intellij以在Angular模板中显示TypeScript错误?我在

模板在Intellij中打开

解决方案

当前无法执行此操作,请投票给stackblitz. If I create a @Input with optional object parameters and use it in the template, I've got an error in console, but Intellij is ok with that. No error whatsoever. Note, I have strict mode on:

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>

terminal output

template open in Intellij

解决方案

No way to do this currently, please vote for WEB-49062 to be notified on any progress with this feature

这篇关于在Intellij/Webstorm中的html中显示打字稿错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆