ngx-mat-select-search - 占位符标签,搜索时没有出现 noEntriesFoundLabel

ngx-mat-select-search - placeholderlabel, noEntriesFoundLabel is not appearing while searching

我正在尝试为 ngx-mat-select-search 包更改 placeholderlabelnoentriesfoundlabel。它不起作用。

这是我的 HTML:

<mat-form-field class="search-field-dropdown" appearance="none">
  <mat-select
    formControlName="country"
    class="matdropdownCustom"
    placeholder="Country"
    placeholderLabel="Find country..."
    noEntriesFoundLabel="'no matching country found'"
  >
    <mat-option>
      <ngx-mat-select-search
        [formControl]="countryFilterCtrl"
      ></ngx-mat-select-search>
    </mat-option>

    <mat-option
      *ngFor="let option1 of filteredCountriesList | async" 
      [value]="option1.name"
      >
        {{ option1.name }}
    </mat-option>
  </mat-select>
</mat-form-field>

您必须ngx-mat-select-search元素放置placeholderLabelnoEntriesFoundLabel,而不是mat-select元素。

<ngx-mat-select-search
    [formControl]="countryFilterCtrl"
    placeholderLabel="Find country..."
    noEntriesFoundLabel="'no matching country found'"
></ngx-mat-select-search>

参考资料

NgxMatSelectSearch Label section