简体   繁体   English

HTML错误出现在vscode中的.ts文件

[英]HTML errors appearing on .ts file in vscode

I have this issue where certain.ts files are lined with errors you'd expect to see in an HTML file, eg "Can't bind to 'ngClass' since it isn't a known property of 'div'" appears over an import in my component example image我有这个问题,其中某些.ts 文件包含您希望在 HTML 文件中看到的错误,例如“无法绑定到 'ngClass',因为它不是 'div' 的已知属性”出现在在我的组件示例图像中导入

I've uninstalled and reinstalled vs code to no avail.我已经卸载并重新安装了 vs code 无济于事。

Turns out the error was caused by extending another component that didn't have angular decorations.原来错误是由扩展另一个没有 angular 装饰的组件引起的。 Fixing this resolved the errors.修复问题解决了错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM