Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Intellisense VS2015 RTM

Reading the release notes, Angular is supposed to have better intellisense in VS2015.

After Just upgrading VS2015 to VS2015RTM I appear to be missing intellisense in script blocks on Razor views, and in js files.

After "file new web application (ASP.NET 5 Preview Template)", I've added a dependency to Angular via the 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 can see the TaskRunner has successfully run the gulp task and generated a lib\angular folder.

enter image description here

I've referenced angular in the layout but i get no intellisense.

enter image description here

Do I need to install something or is the manual copy of that intellisense file required? If so it doesn't feel like that's a vs2015 intellisense enhancement, as I assume it could also be done on VS2013?

UPDATE

I've duplicated the advice from the attached Link and put the angular.intellisense.js file in both the

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

folder and the

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

folder

I now have working Intellisense in VS2013 but not in VS2015.

Also tried adding

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

to the _references.js file but still no angular intellisense.

like image 951
Tim Avatar asked Jul 21 '15 07:07

Tim


1 Answers

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

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

Strange why Microsoft did not added it by default in the RTM version.

UPDATE -

I found the solution - I talked with one of Microsoft's engineers about the issue and he helped me to fix the issue..

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

and then in it you should add a reference to all the JS files you are working with 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 on: Auto-sync JavaScript References and click on ** Update JavaScript References** (which will automatically add all the references in your solution:

_references.js file

After that you will get angular support in the JavaScripts as: angular support

BTW - it works with all the types of the web projects - just add the _references.js file and add a reference to all the JavaScript libraries/files you are using and it will work.

I hope it will help you as well :).

like image 95
iseif Avatar answered Sep 27 '22 20:09

iseif