diff options
author | Swapnali Shadanan Pode <sp00501638@techmahindra.com> | 2019-03-12 15:56:05 +0530 |
---|---|---|
committer | Swapnali Shadanan Pode <sp00501638@techmahindra.com> | 2019-03-12 15:56:05 +0530 |
commit | 76f6f9a24ffba86183ea185c19cb9e49820cda4f (patch) | |
tree | d44042ea7e2c13225663b22a7f920939ef326e32 /cds-ui/client/src/app/common/shared | |
parent | ca4fc097ee3a3eaa3fd1f541b2c3863f1bd81697 (diff) |
search sourecs options issue fixed
Change-Id: I828414c8db8299019c073976509e0cd7408916ce
Issue-ID: CCSDK-804
Signed-off-by: sp00501638 <sp00501638@techmahindra.com>
Diffstat (limited to 'cds-ui/client/src/app/common/shared')
-rw-r--r-- | cds-ui/client/src/app/common/shared/pipes/search.pipe.ts | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/cds-ui/client/src/app/common/shared/pipes/search.pipe.ts b/cds-ui/client/src/app/common/shared/pipes/search.pipe.ts index f5092aff3..092531ee3 100644 --- a/cds-ui/client/src/app/common/shared/pipes/search.pipe.ts +++ b/cds-ui/client/src/app/common/shared/pipes/search.pipe.ts @@ -26,12 +26,11 @@ import { Pipe, PipeTransform } from '@angular/core'; export class SearchPipe implements PipeTransform{ - 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); - }); - } + transform(item: any, searchText: any): any { + if(searchText == null) return item; + + return item.filter(function(search){ + return search.type.toLowerCase().indexOf(searchText.toLowerCase()) > -1; + }) + } }
\ No newline at end of file |