Skip to content
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

A pipe function to aid collections filtering #252

Open
PK1A opened this issue Jul 24, 2014 · 1 comment
Open

A pipe function to aid collections filtering #252

PK1A opened this issue Jul 24, 2014 · 1 comment

Comments

@PK1A
Copy link
Contributor

PK1A commented Jul 24, 2014

While rendering collections of data a common scenario is to provide possibility to filter a collection (limit it to records matching certain criteria). It is convenient to write something along those lines:

 {foreach itemIdx, item in ctrl.tableItems | filter:criteria}...{/foreach}

There are many ways of expressing filtering criteria, one could think of:

  • a string / RegExp that is used to match items
  • a function, similar to the one used in Array.prototype.filter

In any case it would be convenient to have such a helper in the framework as the case for filtering is very common. It would be also go hand-in-hand with the ordering helper already built-in.

@PK1A
Copy link
Contributor Author

PK1A commented Jul 24, 2014

This is somehow linked to #239 as we need to be able to read the size of a filtered collection.

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

No branches or pull requests

1 participant