简体   繁体   English

Intellisense绑定是否可以在带有Visual Studio Code的Angular中使用html?

[英]Does intellisense for binding works in html with visual studio code for angular?

I typically use intelliJ (back-end/java) and the intellisense is working for html (basically am able to go to the definitions of the bound properties). 我通常使用intelliJ(后端/ java),而intellisense正在为html工作(基本上可以转到绑定属性的定义)。 And its doing OK with angular... 而且它与角...

I tried to do the same with VS Code (as i am trying to evaluate is VS code gives anything more other than chrome-debugging in VS code), but somehow the intelliSense is not working. 我试图对VS Code做同样的事情(因为我试图评估VS代码除了提供VS代码中的镀铬调试功能以外,还提供其他功能),但是intelliSense无法正常工作。

I feel like its basic feature, probably I am missing something in my IDE. 我觉得它的基本功能,可能是我的IDE中缺少一些东西。

  1. Is it supposed to work? 它应该工作吗?
  2. Anything additional config/setup i need to make it work... 我需要进行其他任何配置/设置...

And yes, intellisense in ts files is working as expected... 是的,ts文件中的intellisense可以按预期工作...

Note: 注意:

Installing Angular Language Service extension did not do the trick for me. 安装Angular Language Service扩展对我没有帮助 After installing and reloading ( https://github.com/angular/vscode-ng-language-service ) when i tried to go to definitions its just keeps spinning (loading). 安装并重新加载( https://github.com/angular/vscode-ng-language-service )后,当我尝试进入定义时,它一直在旋转(加载)。 Not even sure what its doing in background as i don't see obvious options to see the details. 我什至不知道它在后台做什么,因为我看不到明显的选项来查看细节。

Regards. 问候。

John Papa the author of both AngularJS and Angular's style guide and Microsoft employee (makers of VSCode) has a blog where he talks about this very thing. John Papa是AngularJS和Angular的风格指南的作者,并且Microsoft员工(VSCode的制造商)在他的博客中谈到了这件事。 https://johnpapa.net/essential-angular-vs-code-extensions/ https://johnpapa.net/essential-angular-vs-code-extensions/

I would recommend any of his talks or blog articles! 我会推荐他的任何演讲或博客文章! Regardless, the plugin you're looking for is 无论如何,您要找的插件是

Angular Language Service - This extension provides a rich editing experience for Angular templates, both inline and external templates. Angular语言服务-此扩展为内联和外部模板的Angular模板提供了丰富的编辑体验。 This extension is brought to you by members of the Angular team. 这个扩展是由Angular团队的成员带来的。 It is fantastic at helping write solid code in the html templates. 帮助在html模板中编写可靠的代码非常棒。

https://marketplace.visualstudio.com/items?itemName=Angular.ng-template https://marketplace.visualstudio.com/items?itemName=Angular.ng-template

and/or 和/或

Path Intellisense - Visual Studio Code plugin that autocompletes filenames. 路径Intellisense-自动完成文件名的Visual Studio Code插件。 Hopefully, VS Code will bake this in at some point. 希望VS Code可以在某个时候烘烤它。 Until then, this is a keeper. 在那之前,这是一个门将。

https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense

VSCODE扩展

Here are some extensions that may be useful to you. 这是一些可能对您有用的扩展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM