could you please tell me how to add filter in angular2.Actually whenever user type anything in input field it should filter the list as in autocomplete ..can we do in angular 2 ?
here is my code http://plnkr.co/edit/hfhY6EdLVNOLP6d4QsWP?p=preview
<div>
<input type='text' #inputD>
<ul>
<li *ngFor="#elt of elements | async">{{elt.name}}</li>
</ul>
</div>
update here is my filter
http://plnkr.co/edit/hfhY6EdLVNOLP6d4QsWP?p=preview
import {Injectable, Pipe} from 'angular2/core';
@Pipe({
name: 'filter'
})
@Injectable()
export class Listfilter {
transform(items: any[], args: any[]): any {
return items.filter(item => item.column === args[0]);
}
}
how to add key up and key down event to fliter list in angular 2