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?
To access this options page, choose Tools > Options, and then choose Text Editor > C# > IntelliSense.
Please try: Go to Visual Studio Installer, click Modify , uncheck IntelliCode in Individual components, then click Modify button to save the change, wait for the installation to complete, and then reinstall IntelliCode . In Visual Studio, go to Tools->Options->IntelliCode to check if the setting is Default.
With your project open in Visual Studio, right-click on a folder or your project node in Solution Explorer (right pane), and choose Add > New Item. In the New File dialog box, under the General category, choose the file type that you want to add, such as JavaScript File, and then choose Open.
Because 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With