Angular Intellisense VS2015 RTM

Reading the release notes, Angular should have the best intellisense in VS2015 .

After a simple upgrade from VS2015 to VS2015RTM, it seems to me that there is no intellisense in script blocks in Razor views and in js files.

After the β€œnew new web application (ASP.NET 5 Preview Template)”, I added a dependency on Angular via bower.json

{ "name": "ASP.NET", "private": true, "dependencies": { "bootstrap": "3.0.0", "bootstrap-touch-carousel": "0.8.0", "hammer.js": "2.0.4", "jquery": "2.1.4", "jquery-validation": "1.11.1", "jquery-validation-unobtrusive": "3.2.2", "angular": "~1.4.3" } } 

and I see that TaskRunner has successfully completed the gulp task and generated the lib \ angular folder.

enter image description here

I am referencing Angular in the layout, but I am not getting intellisense.

enter image description here

Do I need to install something or is it a manual copy of this intellisense file? If this does not look like an enhancement to intellisense vs2015, I believe it could also be done on VS2013?

UPDATE

I duplicated the advice from the attached link and put the angular.intellisense.js file as in

Program Files (x86) \ Microsoft Visual Studio 12.0 \ JavaScript \ Links

folder and

Program Files (x86) \ Microsoft Visual Studio 14.0 \ JavaScript \ Links

Folder

Now I have Intellisense running in VS2013, but not in VS2015.

Also tried adding

 /// <reference path="lib/angular/angular.js /> 

to the _references.js file, but there is still no Angular intellisense.

+5
source share
1 answer

I installed the NuGet package "AngularJS.Intellisense" and it worked for me.

https://www.nuget.org/packages/AngularJS.Intellisense/

It is strange why Microsoft did not add it by default in the RTM version.

UPDATE -

I found a solution - I talked with one of the Microsoft engineers about the problem, and he helped me solve the problem.

All you have to do is add a new JS file to your wwwroot folder: _references.js

and then in it you should add a link to all the JS files you work in, in the following format:

 /// <autosync enabled="true" /> /// <reference path="js/main.js" /> /// <reference path="lib/angular/angular.js" /> /// <reference path="lib/angular/index.js" /> 

or in the solution explorer - right-click on the _references.js file and click: Auto-sync JavaScript links and click ** Update JavaScript links ** (which will automatically add all links in your solution:

_ reference.js file

After that, you will get angular support in JavaScripts like: angular support

BTW - it works with all types of web projects - just add the _references.js file and add a link to all the JavaScript libraries / files that you use, and it will work.

Hope this helps you too :).

+5
source

All Articles