ahmed elbarbary

ahmed elbarbary

  • 1.1k
  • 892
  • 37.1k

How to apply multi ngif to data display on table?

May 20 2020 9:39 AM
I need to control column name based on multi condition *ngIf but i don't know which tag used and where :
  1. *ngIf="coln=repcon.fieldName && repcon.columnType=1" then display data as icon link on field onlineurl  
  2. *ngIf="coln=repcon.fieldName && repcon.columnType=2" then make it as hidden field to field onlineurl  
I work on angular 7 app I displayed dynamic data no fixed header or content
  1. <thead >  
  2. <tr>  
  3. <th *ngFor="let coln of headerCols">  
  4.   
  5.   
  6. {{coln}}  
  7.   
  8. </th>  
  9.   
  10.   
  11. </tr>  
  12. </thead>  
  13. <tbody>  
  14. <ng-container *ngFor="let repcon of ReportControl">  
  15. <ng-container *ngFor="let repdata of ReportData">  
  16. <tr *ngFor="let rep of reportdetailslist">  
  17.   
  18. <td *ngFor="let coln of headerCols">  
  19.   
  20. <span>{{rep[coln]}}</span>  
  21. // i think here can applied multi ng if but which tag used .  
  22. </td>  
  23.   
  24. </tr>  
  25. </ng-container>  
  26. </ng-container>  
  27.   
  28. </tbody>  
sample data
  1. ReportId onlineurl reportdate  
  2. 1222 localhost:5000/ 12-12-2018  
  3. 1222 localhost:7000/ 12-01-2019  
  4. 1222 localhost:9000/ 12-12-2020  
  5. control report  
  6. reportid fieldname columntype  
  7. 1222 onlineurl  

Brought to you by:

Answers (1)