2016-07-05 19 views
3

我一直致力于设置Visual Studio代码来专门配合我们在工作中使用的Angular 1.5代码库。下面是我做了这一点:如何在VS代码上设置AngularJS intellisense

  • 安装TSD
  • tsd query -r -o -a install angular -s
  • 我的文件的顶部添加一个参考tsd.d.ts像这样:

/// <reference path="../typings/tsd.d.ts" /> 
 

 
(function() { 
 
    'use strict'; 
 

 
    angular.module('moduleName').controller('CtrlName', 
 
    ['$scope', '$window',function ($scope, $window){ 
 

 
      
 
    } 
 
})();

在这一点上,看起来我有部分成功;当我将鼠标悬停在angular关键字我看到特定类型的信息(即namespace angularvar angular: ng.IAngularStatic),但没有任何类型的信息即将通过角特定的依赖关系,即当我将鼠标悬停在$窗口,它告诉我,这是any型。

我的问题:

  1. 更重要的是我必须做的就是智能感知正常工作?
  2. 有没有解决其在每一个JS文件,我在代码库的顶部添加引用能够获得智能的工作方式?
+0

http://stackoverflow.com/questions/30206049/how-to-set-intellisense-for-angular-js-and-javascript-in-visual-studio-code –

+0

@ a3.14_Infinity我看到那。它不会帮助不幸 - 它没有解释为什么智能感知工程的角度而不是角度的服务。 – jpoh

+0

https://www.nuget.org/packages/AngularJS.Intellisense/和https://github.com/jmbledsoe/angularjs-visualstudio-intellisense。这些帮助你吗? –

回答

相关问题