Skip to content

Instantly share code, notes, and snippets.

Created May 14, 2017 10:44
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 anonymous/6f67ef24dfaabb14905d5dc1b5b7b706 to your computer and use it in GitHub Desktop.
Save anonymous/6f67ef24dfaabb14905d5dc1b5b7b706 to your computer and use it in GitHub Desktop.
<tr *ngFor="let post of posts | search: 'title': 'content': postSearch">
transform(value: any, field1: string, field2: string, search: string)
{
if(search == "") {
return value;
}
return value.filter((res) => {
return res[field1].includes(search) || res[field2].includes(search);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment