Thursday, 25 January 2018

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);

No comments:

Post a Comment

Row based styling for Primeng DataTable using Angualr 2,4

------------------------------------Component.Html---------------- < p -dataTable id = "Tbl" [ rowStyleClass ]= " Fu...