Filter Witn Class Array Object in angular 2

************Create First Funtion  In Component.ts File *********

transform(items: any[], field: string, value: string): any[] {
    if (!items) return [];
    return items.filter(it => it[field] == value);
  }


----------------------------------------------------
 _GenericClass: GenericClass;//Generic Class Obejct

let objLast = this.transform(this._GenericClass.Data, 'ParentGroup', Value);

Post a Comment

0 Comments