Angular 2 filter/search list

前端 未结 12 1402
眼角桃花
眼角桃花 2020-11-27 14:25

I\'m looking for the angular 2 way to do this.

I simply have a list of items, and I want to make an input whos job is to filter the list.



        
12条回答
  •  感动是毒
    2020-11-27 15:01

    Currently ng2-search-filter simplify this works.

    By directive

    
      {{item.name}}
    
    

    Or programmatically

    let itemsFiltered = new Ng2SearchPipe().transform(items, searchText);
    

    Practical example: https://angular-search-filter.stackblitz.io

提交回复
热议问题