Last active
August 8, 2016 03:23
-
-
Save santiblanko/452df1f1cf403ce11f65ae8d77135ed0 to your computer and use it in GitHub Desktop.
search pipe angular2 basic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Pipe({ | |
| name: 'showfilter', | |
| pure: true | |
| }) | |
| export class ShowPipe { | |
| transform(value, term) { | |
| return value.filter(item => { | |
| if( item.name.toLowerCase().indexOf(term) >= 0 ) return item; | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment