Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellisense for angular.js does not work in a javascript file

I'm using Visual Studio 2013 which supports Intellisense for Angular.js. Intellisense does indeed work when I create an Angular.js module within a script tag in a HTML5 file. However, when I attempt to create the same module in a javascript file I get no Intellisense. I'm a bit baffled as to why this is the case.

Intellisense working in HTML file:

Angular.js Intellisense in HTML file

No Intellisense in blank javascript file:

No Intellisense in javascript file

I do not have Resharper installed in VS2013. Thanks in advance for your time and any advice!

like image 587
Blake Mumford Avatar asked Nov 30 '13 01:11

Blake Mumford


2 Answers

The javascript file needs a reference to angular js so it know what you're talking about. It looks like this:

/// <reference path="ScriptFile1.js" />

See here for more info http://msdn.microsoft.com/en-us/library/vstudio/bb385682.aspx

like image 180
Jon B Avatar answered Jan 04 '23 05:01

Jon B


Reference angular.js file on top of your JavaScript file like this:

/// <reference path="../scripts/angular.min.js" />
like image 22
sadeghhp Avatar answered Jan 04 '23 06:01

sadeghhp