Filter Service Configuration

File service configuration is service file used to filter data. It includes searching of content, filter of table.

How to use it?

                      
<th class="sort-column" sortable="name" (sort)="onSort($event)">Name</th>
<th class="sort-column" sortable="position" (sort)="onSort($event)">Position</th>
<th class="sort-column" sortable="office" (sort)="onSort($event)">Office</th>
filterService.searchList = data;
this.advanceTableData$ = filterService.filterData$.asObservable();
this.loading$ = filterService.loading$.asObservable();
this.filterService.criteriaFilter = ["name", "position", "office"];
                      
                    

onSort($event) is an event emit by sortable directive. It emits the column name. Based on column filter service filter the service and return data back to component and component reflect the data to UI

searchList its searching data.

criteriaFilter its criteria on which field you want to filter.