Visual Studio Code找不到Angular变量的所有引用

时间:2018-06-29 11:25:28

标签: angular visual-studio-code

我在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>

如果我先依次单击myVariableFind All References,将找不到模板中的引用。

1 个答案:

答案 0 :(得分:0)

我使用TypeScript Hero。 https://github.com/buehler/typescript-hero/wiki

或使用“ VS代码”设置:     “ typescript.autoImportSuggestions.enabled”:是,