I have implemented an angular2-table example and added a pipe for filtering the table based on name when selecting the "input radio"
Here is my custom pipe filter :
import * as _ from "lodash";
import {Pipe, PipeTransform} from "@angular/core";
@Pipe({
name: "dataFilter"
})
export class DataFilterPipe implements PipeTransform {
transform(array: any[], query: string): any {
if (query) {
return _.filter(array, row=>row.name.indexOf(query) > -1);
}
return array;
}
}
You can view the Plunker example here: http://plnkr.co/edit/hhv4e8WliLkmpW2Bmn3A?p=preview
Can someone guide me on how to implement table filtering using input radio buttons?