title: "Cannot read property 'parentNode' of undefined"- Angular, HTML, Typescript
body: <p>I'm getting an error which reads:
  "Cannot read property 'parentNode' of undefined". I am using Angular. I have Typescript and HTML files. The code is below.</p>
  
  <p>Typescript:</p>
  
  <pre><code>public deleteRow(btn) {
      console.log("parentNode:" + btn.parentNode);
      var row = btn.parentNode.parentNode;
      row.parentNode.removeChild(row);
    }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;tr bg-color="#2b5dd1" *ngFor="let row of rows; let even = even; let odd = odd" [ngClass]="{ odd: odd, even: even}" class = "even"&gt;
        &lt;td&gt;&lt;input type="text" [(contenteditableModel)]="text1"  tabindex="1"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" [(contenteditableModel)]="text2" tabindex="2"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" [(contenteditableModel)]="text2" tabindex="3"&gt;&lt;/td&gt;
        &lt;td class="actions"&gt;
          &lt;input type="button" value="Delete" (click)="deleteRow(this)"&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>I am not sure what's going wrong, it should work perfectly.
  I'm working on putting together a Stackblitz to demonstrate how it works.
  Any comments or suggestions would be appreciated.</p>
  
  <p>Thank you.</p>