📜  以角度过滤表格的最佳方法 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:14.811000             🧑  作者: Mango

代码示例1
@Pipe({
   name: 'tableFilter'
})
export class TableFilterPipe implements PipeTransform {

   transform(list: any[], value: string) {

      // If there's a value passed (male or female) it will filter the list otherwise it will return the original unfiltered list. 
      return value ? list.filter(item => item.gender === value) : list;

   }
}