Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 609
Sam Avatar asked Apr 14 '13 16:04

Sam


Video Answer


3 Answers

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

like image 105
John Bledsoe Avatar answered Sep 24 '22 13:09

John Bledsoe


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.

like image 24
kayz1 Avatar answered Sep 22 '22 13:09

kayz1


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) {...}
like image 32
rob Avatar answered Sep 21 '22 13:09

rob