Skip to content

Instantly share code, notes, and snippets.

@freshcutdevelopment
Last active December 16, 2015 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freshcutdevelopment/e782e01d844bd6ddecb6 to your computer and use it in GitHub Desktop.
Save freshcutdevelopment/e782e01d844bd6ddecb6 to your computer and use it in GitHub Desktop.
Aurelia filter value converter
export class FilterValueConverter {
toView(array, searchTerm, filterFunc) {
return array.filter((item) => {
let matches = searchTerm && searchTerm.length > 0 ? filterFunc(searchTerm,item): true;
return matches;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment