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

Multiple filters does not work #27

Open
sajeetharan opened this issue Feb 6, 2018 · 2 comments
Open

Multiple filters does not work #27

sajeetharan opened this issue Feb 6, 2018 · 2 comments

Comments

@sajeetharan
Copy link

sajeetharan commented Feb 6, 2018

<tr *ngFor="let list of doctors | filter:doctorName | filter:clinicName | filter:specialization| paginate: { itemsPerPage: 25, currentPage: p }">
@aVolpe
Copy link
Collaborator

aVolpe commented Apr 10, 2018

Hey @sajeetharan the filter works well with two filters.

First, the filter implement a type of deep search that will search in every single property of you.

If you have a list like this:

    items: any[] = [
      {name: 'archie', lastName: 'test1'},
      {name: 'archie', lastName: 'test4'},
      {name: 'jake', lastName: 'test2'},
      {name: 'richard', lastName: 'test3'}];

And a use like this:

    <input type="text" [(ngModel)]="firstName">
    <input type="text" [(ngModel)]="lastName">
    <div *ngFor="let item of items | filter:firstName | filter:lastName">
        <p>
            {{item.name}} {{item.lastName}}
        </p>
    </div>

And put archie in the first input, and test4 in the second, the list will show you only the second record.

Can you share the relevant pieces of your code to allow us to check it?

@aVolpe
Copy link
Collaborator

aVolpe commented Apr 10, 2018

Also, can you please add your angular and ng2-search filter version?

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

No branches or pull requests

2 participants