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

Filtered Result #12

Open
kawoki opened this issue Aug 19, 2017 · 3 comments
Open

Filtered Result #12

kawoki opened this issue Aug 19, 2017 · 3 comments
Labels

Comments

@kawoki
Copy link

kawoki commented Aug 19, 2017

How can i get filtered result from filter?

@solodynamo
Copy link
Owner

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

@kawoki
Copy link
Author

kawoki commented Aug 19, 2017

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

@aVolpe
Copy link
Collaborator

aVolpe commented Apr 10, 2018

@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 aVolpe closed this as completed Apr 10, 2018
@aVolpe aVolpe reopened this Apr 10, 2018
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