首页 > 解决方案 > 继承的类模板中的 WebStorm Angular 警告

问题描述

在使用 WebStorm 20193.2 时,我在 Angular 模板中观察到这样的警告:

在此处输入图像描述

因为这些属性在父组件而不是子组件上初始化

@Component({
  selector: 'app-dictionary-dropdown',
  templateUrl: './dictionary-dropdown.component.html',
  ...
})
export class DictionaryDropdownComponent extends Dropdown implements OnInit, OnDestroy {
...

我试图添加到子类implements <name of parent component>,但它没有帮助。

有什么解决方案可以摆脱那些WebStorm 警告吗?

标签: angulartypescriptwebstorm

解决方案


推荐阅读