title: Angular 6 - How to get input value in component.ts from dynamically created input box within a table using *ngFor?
body: <p>I need help in the following scenario: Let say if we created 10 rows for below HTML Then how we'll get all 10 rows Inserted First Name and Last Name Value on FORM SUBMIT in angular 6?</p>
  
  <pre><code>&lt;form name="userForm"&gt;
  &lt;table&gt;
  &lt;tr *ngFor="let item of itemList; let in = index"&gt;
        &lt;td&gt;&lt;input type="text" name="lastname-{{in}}" [(ngModel)]="item.lastname"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="middlename-{{in}}" [(ngModel)]="item.middlename"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/form&gt;
  </code></pre>