在角度4应用中,我使用材料组件自动完成,与文档中给出的示例非常相似:
<md-form-field>
<input type="text" mdInput [formControl]="myControl" [mdAutocomplete]="auto">
</md-form-field>
<md-autocomplete #auto="mdAutocomplete">
<md-option *ngFor="let option of options" [value]="option">
{{ option }}
</md-option>
</md-autocomplete>
我还使用 tslint ,我的模板文件中出现错误,因为语法为[mdAutocomplete]="auto"
:
The property "auto" that you're trying to access does not exist in the class declaration.
如何避免此错误?
答案 0 :(得分:1)