Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @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/>
Add Comment
Please, Sign In to add comment