Visual Studio的code:找不到名字的角度? [英] Visual Studio Code: Cannot find name angular?

查看:225
本文介绍了Visual Studio的code:找不到名字的角度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个角App和它工作正常,但我的调试器显示我找不到名字的角。

I have an Angular App and it works fine, but my debugger is showing me 'Cannot find name angular'.

 var table = angular.module('myTable', ['angularUtils.directives.dirPagination']); 

我包括在我的HTML文件的链接角:

I included the link for angular in my html file:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>

我想也包括还链接bower_components:

I tried also including a link for bower_components also:

<script src="bower_components/angular/angular.min.js"></script>

有在对这个问题的回答一收到错误 - 找不到名称'角'
但我不能够使用它。

There is a answer about this problem at Getting Error - Cannot find name 'angular' but I am not able to use it.

推荐答案

我也有同样的问题,直到我偶然发现这篇文章跑:

I was having the same issue until I ran across this article:

<一个href=\"http://blogs.msdn.com/b/vs$c$c/archive/2015/05/22/getting-started-with-angular-and-visual-studio-$c$c.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/vs$c$c/archive/2015/05/22/getting-started-with-angular-and-visual-studio-$c$c.aspx

基本上,这里就是你有NPM做什么:

Basically, here's what you have to do with npm:

cd (app path)
npm install -g tsd
tsd init
tsd query angular --action install --save

就是这样。当您重新启动VS code你的问题应该消失。

That's it. When you restart VS Code your problem should be gone.

请注意,我没有使用任何///参考链接作为作者在文章中建议,但上述步骤后,我停下来获得关于角不被发现,我已经注意到越来越NG-该消息*选择未来通过在IntelliSense。

Note that I didn't use any of the ///reference links as the author suggested in the article, but after the above steps I stopped getting that message about angular not being found and I have already noticed more ng-* options coming through in Intellisense.

这篇关于Visual Studio的code:找不到名字的角度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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