title: Angular 7 - How to get the data out of a table?
body: <p>I am new to this forum, so if I violate any rules, please tell me!</p>
  
  <p>I have following code in <strong>app.component.html:</strong></p>
  
  <pre><code>&lt;tr *ngFor="let item of items" (click)="getClient($event)"&gt;
      &lt;td&gt; {{ item.nr }} &lt;/td&gt;
      &lt;td&gt; {{ item.content }} &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>In <strong>app.component.ts</strong> I get the data of an API:</p>
  
  <pre><code>export class AuftragslisteComponent implements OnInit {
  
      constructor(public http: HttpClient) { }
  
      getItem() {
          return this.http.get("http://localhost:59643/api/lösa");
      }
  
      items: Object;
      ngOnInit() {
          this.getItem().subscribe(data =&gt; {
              this.items = data;
              console.log(this.items);
              console.log(data);
          })
      }
  
      getClient() {
      }
  }
  </code></pre>
  
  <p>I am try to get the item.nr by clicking a row, but I always got undefined by the alert function in the getClient function, so I deleted it.</p>
  
  <p>Do anyone know how to access the correct item.nr by clicking a row?</p>