简体   繁体   中英

How to prevent column total Count from display on component.html?

I have field total count I need to prevent total Count from display on component.html

I already do it but not working if you can tell me how to do that?

I display data dynamically on header column and body data with angular 7

I try using filter function below but not working

this._displayreport.GetReportDetailsPaging(this.searchData).subscribe((data: any[]) => {

        this.reportdetailslist = data;
  this.headerCols = Object.keys(data[0]);
  this.contentBody=data.filter(item =>item != data[0].totalCount);

      });


    }


  }


<thead>
                  <tr>
                    <th >
                      <ng-container *ngIf="coln != 'totalCount'">

                        {{coln}}
                      </ng-container>
                    </th>


                  </tr>
                </thead>
                <tbody>

                    <tr *ngFor="let rep of contentBody">

                      <td *ngFor="let coln of headerCols">


                        <span> 

                        {{rep[coln]}}
                        </span>
                       </td>
                       </tr>
                      <tbody>

data object represent following data as any[]

companyName: "Innovasic, Inc."
done: "0"
notImpacted: "0"
notificationDate: "2009-11-12"
offilneURL: "https://source.z2data.com/2019/1/13/8/55/47/351/662203977/21527_SPCN.PDF"
onlineURL: "N/A"
pending: "3"
reportDate: "2020-05-07"
revisionID: "272299243"
teamName: "MFG"
totalCount: 79

it solved by change my code above to

this.headerCols = Object.keys(data[0]).filter(x => x !== 'totalCount');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM