Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs VSCode可以';找不到有角度的d.t_Angularjs_Intellisense_Visual Studio Code - Fatal编程技术网

Angularjs VSCode可以';找不到有角度的d.t

Angularjs VSCode可以';找不到有角度的d.t,angularjs,intellisense,visual-studio-code,Angularjs,Intellisense,Visual Studio Code,我在VSCode中打开了角度代码。起初它无法识别角度,因此使用灯泡添加: /// <reference path="../../typings/angularjs/angular.d.ts"/> // 但是它仍然不能识别angular,现在我得到一个错误,说它找不到angular.d.ts.问题似乎是VSCode未能下载文件并创建目录。我在谷歌上搜索了angular.d.ts,发现了它 我创建了“typings/angularj/”文件夹并添加了该文件,现在intellisens

我在VSCode中打开了角度代码。起初它无法识别角度,因此使用灯泡添加:

/// <reference path="../../typings/angularjs/angular.d.ts"/>
//

但是它仍然不能识别angular,现在我得到一个错误,说它找不到angular.d.ts.

问题似乎是VSCode未能下载文件并创建目录。我在谷歌上搜索了angular.d.ts,发现了它


我创建了“typings/angularj/”文件夹并添加了该文件,现在intellisense正在为angular工作:)

您不需要向文件中添加任何内容,VS代码会将angular.d.ts添加到typings文件夹中。VSCode不要求在所有文件中都包含///标记,这样做可能会使编辑器感到困惑


如果您没有看到带有angular intellisense文件的“typings”文件夹,您将无法获得intellisense,您需要重复灯泡步骤。

FYI是VSCode添加的///在我单击灯泡后,当我再次单击灯泡时,它甚至第二次添加了该行。但从未添加文件本身。。。