Visual Studio的code:找不到名字的角度?找不到、角度、名字、Visual

由网友(伱拿着莪的好去爱别人)分享简介:我有一个角App和它工作正常,但我的调试器显示我找不到名字的角。I have an Angular App and it works fine, but my debugger is showing me 'Cannot find name angular'.var table = angular.module('m...

我有一个角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:

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.

阅读全文

相关推荐

最新文章