ng2-search-filter icon indicating copy to clipboard operation
ng2-search-filter copied to clipboard

Filtered Result

Open kawoki opened this issue 7 years ago • 3 comments

How can i get filtered result from filter?

kawoki avatar Aug 19 '17 11:08 kawoki

Hi , If you see the example on README.md , filter returns an array of responses satisfying your query and thats your filtered result.

solodynamo avatar Aug 19 '17 12:08 solodynamo

Sorry if i did not specify it clearly. What i mean is, for example

let member of members | filter:search to let member of (filtered = (members | filter:search)) but this doesn't work. What would i do in other to get the filtered. I wanted to use it somewhere else. Thanks :)

P.S. I'm using Angular4

kawoki avatar Aug 19 '17 13:08 kawoki

@Kisekii you can use *ngIf to store the intermediate value in another variable, check this commit

The relevant part:

    <ng-container *ngIf="(items | filter:firstName) as filtered" >
        <pre>{{ filtered | json }}</pre>
    </ng-container>

aVolpe avatar Apr 10 '18 01:04 aVolpe