我不想为防止空间泄漏而使用ng-select
中的[clearable]
。相反,我只想使用[clearOnBackspace]
,但是当我写下[clearable] = "false"
和[clearOnBackspace] = "true"
时,它不起作用。
enter code here
<ng-select [items]="cities"
bindLabel="name"
placeholder="Select city"
[(ngModel)]="selectedCity"
[clearable]="false"
[clearOnBackspace] = "true"
[excludeGroupsFromDefaultSelection] = "true">
</ng-select>
[clearable]="true"
,则只有在按下退格键时才会清除它。 - Just code