我在 macOS High Sierra 版本 10.13.5 上使用 (Visual Studio) 代码版本 1.24.1。我正在开发 Angular (5) 应用程序,并注意到“查找所有引用”功能不会在 HTML 模板文件中提取变量的出现。是否有启用此功能的插件?
一个例子。让我们假设我们有
import { Component } from '@angular/core';
@Component({
templateUrl: './component.component.html'
})
export class MyComponent {
public myVariable;
}
模板component.compontent.html
是
<div>{{myVariable}}</div>
如果我右键单击 myVariable
,然后单击 Find All References
,将找不到模板中的引用。
最佳答案
我使用 TypeScript Hero。 https://github.com/buehler/typescript-hero/wiki
或使用 VS 代码设置: "typescript.autoImportSuggestions.enabled": true,
关于angular - Visual Studio Code 找不到 Angular 变量的所有引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51100673/