Advertisement
JVFabia

Untitled

Aug 31st, 2020
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export class OtPipe implements PipeTransform {
  2.  
  3.   transform(value: any, arg: any, tag: any): any {
  4.     //  if (arg === '' || arg.length < 2) { return value; }
  5.     if (arg === '') { return value; }
  6.     if (arg === 'All...') { return value; }
  7.  
  8.     const result = [];
  9.     for (const key of Object.keys(value)) {
  10.       for (const key1 of Object.keys(value[key])) {
  11.         if (key1 === tag) {
  12.  
  13.           if (value[key][key1].indexOf(arg) > -1) {
  14.             result.push(value[key]);
  15.           }
  16.         }
  17.       }
  18.     }
  19.  
  20.     return result;
  21.   }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement