ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 251.8k

Error TS2339: property ‘rows’ does not exist on type ‘htmlel

Feb 9 2020 8:07 AM
I work on angular 7
when loop to table html and compile i get error
  1. 95% emitting CopyPlugin  
  2. ERROR in src/app/Pages/part-compare/part-compare.component.ts(25,38): error TS2339: Property 'rows' does not exist on type 'HTMLElement'.  
  3. src/app/Pages/part-compare/part-compare.component.ts(27,26): error TS2339:  
  4. Property 'rows' does not exist on type 'HTMLElement'.  
How to solve this error please ?
What I have tried:
  1. var table = document.getElementById("CompareParts");  
  2. for (var i = 1, row; row = table.rows[i]; i++) {  
  3. for (var j = 0, col; col = row.cells[j]; j++) {  
  4. var Cell = table.rows[i].cells  
  5. this.ACells.push(Cell);  
  6. }  
  7. }  
  8. thisthis.length=this.ACells.length  
  9. for (var x = 0; x < this.ACells.length; x++) {  
  10. this.ARows.push(this.ACells[x]);  

Answers (2)