diff options
author | 2019-12-03 12:12:38 +0200 | |
---|---|---|
committer | 2019-12-03 14:38:23 +0200 | |
commit | d00cf8079f6ec7d791aa92d9991d95ea0bb4a0e6 (patch) | |
tree | a4e3aa972af54847a396e23881c70718f5e4c0d3 /vid-webpack-master/src/app/shared/pipes/searchFilter/search-filter.pipe.ts | |
parent | 3250d40c952004bb08a1f54dcc7f816a9de09e1f (diff) |
free text filter in instantiationStatus Page
Issue-ID: VID-724
Change-Id: I5f363ecc66ff1f1fef9c9d75a12a9c43403aa905
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared/pipes/searchFilter/search-filter.pipe.ts')
-rw-r--r-- | vid-webpack-master/src/app/shared/pipes/searchFilter/search-filter.pipe.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/pipes/searchFilter/search-filter.pipe.ts b/vid-webpack-master/src/app/shared/pipes/searchFilter/search-filter.pipe.ts new file mode 100644 index 000000000..725eacb53 --- /dev/null +++ b/vid-webpack-master/src/app/shared/pipes/searchFilter/search-filter.pipe.ts @@ -0,0 +1,14 @@ +import {Pipe, PipeTransform} from '@angular/core'; + +@Pipe({ + name: 'searchFilter' +}) +export class SearchFilterPipe implements PipeTransform { + transform(items: Object[], searchText: string): any[] { + if(!items) return []; + if(!searchText) return items; + return items.filter( item => { + return JSON.stringify(item).toLowerCase().includes(searchText.toLowerCase()); + }); + } +} |