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

Issue with filter #16

Open
nicolasstrands opened this issue Oct 25, 2017 · 1 comment
Open

Issue with filter #16

nicolasstrands opened this issue Oct 25, 2017 · 1 comment
Labels

Comments

@nicolasstrands
Copy link

nicolasstrands commented Oct 25, 2017

Hello guys,

I have installed the ng2-search-filter in a project I'm working on. My objective was to filter out entries rendered by an ngFor, that gets its data from an SQL query inside a PHP file, where the output is rendered as json data. My data is displayed correctly, but when I add the search filter, and use it as such :

<input type="text" [(ngModel)]="term" 
            class="form-control form-control-sm" placeholder="Search">
<tr *ngFor="let customer of customers | filter: term">
          <td>{{customer.cust_id}}</td>
          <td>{{customer.company_name}}</td>
          <td>{{customer?.contact_person}}</td>
</tr>

My guess is that it's not filtering any data because it doesn't know which column in my data table to filter. Any clue in how to fix this ?

@eliuddyn
Copy link

eliuddyn commented Apr 5, 2018

Hello StrandsMedia, the one in bold and italic resolve your problem:

<input type="text" name="term" [(ngModel)]="term" class="form-control form-control-sm" placeholder="Search">

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