Здесь я написал простую функцию поиска, которая пропускает ошибку, поскольку it.toLowerCase (). Includes (searchText);
Код поиска
@Pipe({
name: 'filter'
})
export class FilterPipe implements PipeTransform {
debuger;
transform(items: any[], searchText: string): any[] {
if(!items) return [];
if(!searchText) return items;
searchText = searchText.toLowerCase();
return items.filter( it => {
return it.toLowerCase().includes(searchText);
});
}
}
Таблица
<input [(ngModel)]="searchText" placeholder="enter search term here">
<table class="table table-sm">
<thead>
<tr>
<th>Auction ID</th>
<th>Auction Name</th>
</thead>
<tbody>
<tr *ngFor="let value of auction?.data | filter :searchText">
<tr>
<th>Auction ID</th>
<th>Auction Name</th>
<tr/>