How to add keys to content body variable when display data dynamically? RRS feed

  • Question

  • User696604810 posted

    I work on angular 7 app I display data and column headers dynamically

    I show content data without header by using content Body Variable

    but problem I face is cannot catch data values or catch data cell values so that

    I need to add key to content body

    my ts code

    this._displayreport.GetReportDetailsPaging(this.searchData).subscribe((data: any[]) => {
    this.reportdetailslist = data;
    this.headerCols = Object.keys(data[0]);
    data.forEach((item) =>{ 
    let values = Object.keys(item).map((key)=> item[key])

    to get contentbody data I do

    <tr *ngFor="let rep of contentBody">
    <td *ngFor="let r1 of rep"><span>{{r1}}</span></td>

    Result Returned

    ReportId onlineurl reportdate
    1222 localhost:5000/ 12-12-2018
    data current for content body displayed on browser console as :
    Expected Result i need to content body display as below

    Thursday, May 21, 2020 12:00 AM

All replies