【问题标题】:ngx-mat-select-search - placeholderlabel, noEntriesFoundLabel is not appearing while searchingngx-mat-select-search - 占位符标签,搜索时没有出现 noEntriesFoundLabel
【发布时间】:2022-03-02 14:52:44
【问题描述】:

我正在尝试更改 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>

【问题讨论】:

    标签: angular select angular-material autocomplete


    【解决方案1】:

    您必须同时为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

    【讨论】:

      猜你喜欢
      • 2019-04-21
      • 2020-04-12
      • 2019-10-25
      • 2020-12-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-12
      • 2016-08-27
      • 2018-03-14
      相关资源
      最近更新 更多