Sam
Sam

Reputation: 14596

angularjs intellisense in visual studio

I've managed to get intellisense for the ng- directives in the HTML. I also get intellisense for most javascript files. However, I have no idea how to get intellisense for bits that are injected. Consider the following:

function mandatsCtrl($scope, Domiciliation, logger, $q) {
}

how to I get intellisense for $q or $scope, which are injected ?

Upvotes: 10

Views: 21492

Answers (4)

John Bledsoe
John Bledsoe

Reputation: 17692

I created a javascript file that you can reference that gives (nearly) complete AngularJS intellisense in JavaScript files, including on your custom factories, services and so forth.

https://github.com/jmbledsoe/angularjs-visualstudio-intellisense

Upvotes: 5

Matty J
Matty J

Reputation: 3156

Have you taken a look at this: https://github.com/matijagrcic/AngularJS-Intellisense-For-Visual-Studio

I have got Intellisense for $scope and $q through one of the extensions I have (think it must be 'Web Essentials 2012'), although it doesn't seem to be particularly intelligent Intellisense - it's just suggestions of every single possible JS method/property.

Upvotes: 1

rob
rob

Reputation: 18523

You can get intellisense on injected parameters (and just about everything else) if you use TypeScript. TypeScript let's you specify the type of your parameters so VS will know how to use them.

eg.

/// <reference path="./angular.d.ts" />

function mandatsCtrl($scope: ng.IScope) {...}

Upvotes: 2

kayz1
kayz1

Reputation: 7444

As far as I know you can't do nothing like that. But if you are using ReSharper you can try AngularJS support for ReSharper plugin. It's in the early stage so I guess we can expect a lot more over time.

Here's another link for HTML5Schema (all the ng-* attributes available in Intellisense). I guess you already have that.

There is also a Chrome plugin AngularJS Batarang. Extends the Developer Tools, adding tools for debugging and profiling AngularJS applications.

I'm looking forward to other answers.

Upvotes: 2

Related Questions