AngularJS + Visual Studio 代码智能感知 [英] AngularJS + Visual Studio Code Intellisense

查看:43
本文介绍了AngularJS + Visual Studio 代码智能感知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 AngularJS 项目并下载了 angular 的@types.(npm install --save-dev "@types/angular")我的问题是,在 VSCode 中,我似乎没有获得 $scope、$http 等 DI 服务的任何类型信息.对于 angular 本身,我得到的列表很好,但对于 $ services 我没有.

I created an AngularJS project and downloaded @types for angular. (npm install --save-dev "@types/angular") My problem is that in VSCode it looks like I don't get any type information for DI services like $scope, $http etc. For angular itself I get the list fine, but for $ services I don't.

例如 $http 被报告为any".

For instance $http is reported as 'any'.

我怎样才能获得这些服务的智能感知和类型信息?

How can I get Intellisense and type information for those services too?

推荐答案

你的做法是对的,总是 VSCode 不支持智能注入服务,例如 $http.

What you have done is correct, always VSCode did not support intellisence for injecting services such as $http.

你无法获得那些 afaik 的支持.由于这已根据此问题停止.

You can't get support for those afaik. Since this has been stopped according to this issue.

这篇关于AngularJS + Visual Studio 代码智能感知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆