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

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

Open
schwarcu opened this issue Apr 2, 2018 · 1 comment
Open

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

schwarcu opened this issue Apr 2, 2018 · 1 comment
Labels

Comments

@schwarcu
Copy link

schwarcu commented Apr 2, 2018

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>
@aVolpe
Copy link
Collaborator

aVolpe commented Apr 5, 2018

Hi @schwarcu,

I will try to reproduce your environment, please check this project, and tell me if the angular dependencies are correct?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants