-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Add directive for easy filtering #104
Comments
Hi @macjohnny, I'm currently adding this library into our app, and because there are a lot of select components that need this, I'm trying to implement an additional directive. For now I'm only concerned with the simplest case, single selection with client-side data. A directive that will offload some of the repetitive filtering work is not that difficult to be implemented, probably with some two-way bound array that will represent the filtered data. But how can we take pipes into account here? I can have an What do you think of the approach of adding a directive on the Are there some obvious pitfalls with this apporach? Thank you! |
@miroslavgrozdanovski thanks for looking into this!
however, you could look at the approach in https://github.com/bl4y/mat-searchable, this would also be great to include here. |
@macjohnny, thanks for the prompt response! Thanks for pointing out the problems. I'm not using a pre-set filter, so I didn't notice the first one, but the second is definitely an issue (I just tried it). Pointing to that other library was also helpful, since it looks like my requirements were tackled quite nicely there. I'm currently combining the two libraries and it looks like it works perfectly so far! I did this by copying I think that adding similar directives like these would make your library even better, as it looks like a good combination. The next thing I'm looking into is handling option groups, but that can also be solved in a generic way inside the |
@macjohnny, do you have an idea how can we use these directives to implement filtering through option groups in a generic way? I tried something, but it was not successful. Basically the idea is to inject the Option Groups and entirely hide all groups which don't have any options that match the current search term. I was not able to inject child structural directives into a parent structural directive and that's where I got stuck... Any idea or advice would be much appreciated :) |
The text was updated successfully, but these errors were encountered: