也许我错过了一些东西,但是我一直在使用visual studio代码进行角度开发一段时间了,虽然像angular这样的图书馆的intellisense正在工作,但它不能用于我自己的javascript代码。例如:
function Test3() {
var _this = this;
this.doSomething = function (test) {
return 1;
}
// intellisense not working (no suggestions after typing _this):
_this.doSomething();
}
// intellisense working (intellisense finds test3):
var t = new Test3();
// not suggestions (intellisense doesn't find doSomething() after typing t)
t.doSomething();
另一个例子:
var service = {};
service.doSomething = function() {
return 2;
}
// intellisense not working (no suggestions after typing service.)
service.doSomething();
我在几台开发机器上试过这个,即使现在使用最新版本(0.9.2),它仍然无效。有一些我不知道的设置吗?以上所有示例在VS2013 / 2015中都具有正确的智能感知。