diff options
Diffstat (limited to 'vid-webpack-master/src/app/shared/pipes/data-filter.pipe.ts')
-rw-r--r-- | vid-webpack-master/src/app/shared/pipes/data-filter.pipe.ts | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/vid-webpack-master/src/app/shared/pipes/data-filter.pipe.ts b/vid-webpack-master/src/app/shared/pipes/data-filter.pipe.ts deleted file mode 100644 index 1ff836762..000000000 --- a/vid-webpack-master/src/app/shared/pipes/data-filter.pipe.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Created by cp2122 on 1/4/2018. - */ -import { Pipe, PipeTransform } from '@angular/core'; - -@Pipe({ - name: 'dataFilter' -}) -export class DataFilterPipe implements PipeTransform { - keys = []; - transform(items: any, args: string): any { - if (items != null && items.length > 0) { - let ans = []; - - if (this.keys.length === 0) { - this.keys = Object.keys(items[0]); - } - for (let i of items) { - for (let k of this.keys) { - if (i[k] !== null && i[k].toString().match('^.*' + args + '.*$')) { - ans.push(i); - break; - } - } - } - return ans; - } - } -} |