1

我尝试使用以下方法和类似方法删除 mat-autocomplete 选项列表中的所有项目,但是尽管清除了文本字段中的值,但列表项仍然存在于列表中。我可以完全清除这个列表吗?

this.inputControl[id].setValue(''); // clear via form control (it just clear input field)

this.filteredOptions = []; // clear via filteredOptions parameter of mat-autocomplete

this.options = []; // tried to set the option value to empty 

我也看看 API,但不幸的是没有这样的功能:(

4

0 回答 0