typescript - 在 Intellij/Webstorm 中的 html 中显示打字稿错误
问题描述
是否可以设置 Intellij 在 Angular 模板中显示 TypeScript 错误?我在stackblitz上共享了以下虚拟应用程序。如果我@Input
使用可选对象参数创建一个并在模板中使用它,我会在控制台中遇到错误,但 Intellij 可以。没有任何错误。注意,我有严格模式:
tsconfig.json
"angularCompilerOptions": {
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
数据.ts
export interface Data {
id?: number;
title?: string;
}
数据组件.ts
@Component({
selector: 'app-data',
templateUrl: './data.component.html',
})
export class DataComponent {
@Input()
public data?: Data;
}
data.component.html
<p>{{data.title}}</p>
终端输出
在 Intellij 中打开的模板
解决方案
目前无法做到这一点,请投票支持WEB-49062以获取有关此功能的任何进展的通知
推荐阅读
- flutter - A way to define origin for a Flutter WebView object to make http/https calls
- asp.net-mvc-4 - Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) when adding ssl binding
- python - 如果任何目录没有读取权限,pysftp.Connection.walktree() 将失败
- typescript - Union type from key of another type
- tensorflow - (0) Unavailable: {{function_node __inference_train_function_53748}}
- c# - Windows 窗体应用程序的布局未正确显示
- elasticsearch - ElasticSearch 使用时间戳作为文档版本
- mysql - 备份配置单元中使用的 MySQL 表模式
- apache-kafka - Kafka如何处理乱序批次
- php - 通过 XMLRPC 和 PHP odoo V14 更新手头数量