Intellisense for angular.js not working in javascript file

I am using Visual Studio 2013 which supports Intellisense for Angular.js. Intellisense really works when I create the Angular.js module in the script tag in the HTML5 file. However, when I try to create the same module in a javascript file, I do not get Intellisense. I am a little puzzled by why this is so.

Intellisense works in an HTML file:

Angular.js Intellisense in HTML file

No Intellisense in empty javascript file:

No Intellisense in javascript file

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

+7
visual-studio-2013
source share
4 answers

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

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

For more details see here http://msdn.microsoft.com/en-us/library/vstudio/bb385682.aspx

+17
source share

The angular.js link on top of your JavaScript file is as follows:

 /// <reference path="../scripts/angular.min.js" /> 
+6
source share

Make sure you have an uncompressed js file in your project. Visual Studio cannot read intellisense from js mini file

0
source share

If you are developing a NodeJs project, make sure that you select the right property for the js file. "Build action" must be equal to "Content", otherwise intellisense will not work.

Properties for js file

0
source share

All Articles