Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Doesn't filter search term with 2 or more characters #35

@schwarcu

Description

@schwarcu

Looks like this repo is forgotten but I will ask anyway.

I have super simple angular 4 app which feches list of currencies with their rates from data.fixer.io/api/
I use ng2-search-filter to search within the list of currencies. However it filters only when I type 1 character. If my search term is 2 or more letters the result is empty.

Anyone know knows how to solve this?

<div *ngIf="!success">
  <mat-progress-bar mode="query" color="accent"></mat-progress-bar>
</div>
<mat-card class="topnav">
  <span class="topbarelem">
    <mat-form-field>
      <input matInput [matDatepicker]="picker" [formControl]="serializedDate" placeholder="Choose a date">
      <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
      <mat-datepicker #picker></mat-datepicker>
    </mat-form-field>
  </span>
  <span class="topbarelem">
    <button class="fetch" mat-raised-button color="accent" (click)="fetchRates()">Fetch</button>
  </span>
  <span *ngIf="success" class="topbarelem info">
    Base {{base}} of {{date}}.
  </span>
  <span class="search">
    <mat-form-field class="example-full-width">
      <input matInput placeholder="Filter currency" type="search" [(ngModel)]="searchterm">
    </mat-form-field>
  </span>
</mat-card>
<mat-card>
  <mat-card-content>
    <mat-list role="list">
      <mat-list-item *ngFor="let key of keys | filter:searchterm" role="listitem">
        {{key}}: {{rates[key]}}
      </mat-list-item>
    </mat-list>
  </mat-card-content>
</mat-card>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions