I am trying to filter my list using pipe I didn't get expect out .I don't knwo how to send input field value to pipe.
here is my code
https://plnkr.co/edit/WFMo8Az7BSJaRJAVVxyE?p=preview when I type "a" it should only display "abc" in list
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'listpipe' })
export class ListPipe implements PipeTransform {
transform(items: any[], filter: string) {
if (!items || !filter) {
return items;
}
return items.filter(item => item.name.indexOf(filter) !== -1);
}
}