admin管理员组文章数量:1222240
I updated ~/Scripts/_references.js
with
/// <autosync enabled="true" />
/// <reference path="angular.js" />
/// <reference path="angular-route.js" />
and in my app.js
I can see some intellisense working, which is great
but go a little further and it doesn't work anymore.
Any ideas on why this happens or ways to make it work?
I updated ~/Scripts/_references.js
with
/// <autosync enabled="true" />
/// <reference path="angular.js" />
/// <reference path="angular-route.js" />
and in my app.js
I can see some intellisense working, which is great
but go a little further and it doesn't work anymore.
Any ideas on why this happens or ways to make it work?
Share Improve this question asked Dec 13, 2013 at 14:43 kenwarnerkenwarner 29.1k31 gold badges133 silver badges174 bronze badges2 Answers
Reset to default 8Because you are using dependency injection
, Visual Studio has no way to figure out what are the types of the arguments.
This is a common problem with Javascript intellisense and, since Javascript does not allow for explicit type annotations, it seems that there is no clear way to work around it.
However, this can be achieved easily using Typescript (which has a VS2013 extension) and angular types where your code would look like:
angular.module('example', ['ngRoute'])
.config([ '$locationProvider',
function ($locationProvider : ng.ILocationProvider) {
$locationProvider. // Intellisense would work here.
}
]);
I built a library to do just this:
https://github.com/jmbledsoe/angularjs-visualstudio-intellisense
本文标签: angularjsEnabling javascript intellisense for external libraries in Visual StudioStack Overflow
版权声明:本文标题:angularjs - Enabling javascript intellisense for external libraries in Visual Studio - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739381304a2160718.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论