ken*_*ner 13 javascript intellisense angularjs visual-studio-2013
我更新~/Scripts/_references.js了
/// <autosync enabled="true" />
/// <reference path="angular.js" />
/// <reference path="angular-route.js" />
Run Code Online (Sandbox Code Playgroud)
在我看来,app.js我可以看到一些intellisense工作,这是伟大的

但是走得更远,它不再起作用了.

有关为什么会发生这种情况或使其发挥作用的任何想法?
因为您正在使用dependency injection,Visual Studio无法确定参数的类型.
这是Javascript intellisense的常见问题,并且由于Javascript不允许显式类型注释,似乎没有明确的方法来解决它.
但是,这可以使用Typescript(具有VS2013扩展)和角度类型轻松实现,其中代码如下所示:
angular.module('example', ['ngRoute'])
.config([ '$locationProvider',
function ($locationProvider : ng.ILocationProvider) {
$locationProvider. // Intellisense would work here.
}
]);
Run Code Online (Sandbox Code Playgroud)
我建了一个库就可以做到这一点:
https://github.com/jmbledsoe/angularjs-visualstudio-intellisense