AngularJS intellisense not working on Visual Studio 2015

后端 未结 11 1369
粉色の甜心
粉色の甜心 2020-11-30 01:38

According to this post intellisense should also be working on the new VS 2015, but so far I only get intellisense for the angular object and not for the dependencies or my c

11条回答
  •  渐次进展
    2020-11-30 02:23

    None of the above work for me. Mine is Visual Studio 2017 - Professional

    Yet I got it working using my solution here -->

    1. You have to reference the source by an enclosed /// even the source is in the same folder where you code is.
    2. Do NOT USE minified source. All your source has to be non-minified.
    3. If you store your path stmts in _reference.js file, make sure that file is at the same dir where your code file is.

    Although I can put the reference stmt inside my code file, I chose to use a separate file "_reference.js" to store it.

    You can put this with your code :

    /// 
    
    var app = angular.module('app', ['ui.grid', 'ui.bootstrap']);
    app.controller('MainCtrl', ['$scope', '$http', function ($scope, $http) {
    

    Or you can enter this line into your _reference.js file

    /// 
    

    After you have done all the above, you should be able to see the angular intellisense.

    You can do the same thing for others' intellisense like jQuery, Anytime, _underscore, etc... just keep adding path statements into the _reference.js file and you can also copy that _reference.js file to other websites if they have the same dir struct. Good luck!

提交回复
热议问题