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.
I've referenced angular in the layout but i get no intellisense.
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.
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:
After that you will get angular support in the JavaScripts as:
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 :).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With