我安装了WebStorm的新副本,并打开了一个现有的Angular项目。
当我在项目中打开任何HTML文件时,IDE会为div.html文件中的所有标记显示“无法找到div” 。在几秒钟的时间内,IDE正常运行,然后显示“ 2.5.3 Typescript”选项卡,其中包含TypeScript错误列表。
Some Typescript tab errors:
Error:(1, 2) TS2304: Cannot find name 'div'.
Error:(3, 4) TS2304: Cannot find name 'div'.
Error:(3, 9) TS2304: Cannot find name 'ngIf'.
Run Code Online (Sandbox Code Playgroud)
我尝试使缓存无效并重新启动。我尝试禁用TSLint。我尝试为某些属性/标签注入语言。
甚至index.html抛出一堆TypeScript错误。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="">
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我希望.html文件中没有红色的波浪形标记,因为它们都是有效的。在VS Code中可以正常工作。
| 归档时间: |
|
| 查看次数: |
531 次 |
| 最近记录: |