title: How to save the data of the inputs generated by *ngFor
body: <p>So, I'm working with Angular 5 and I have two arrays with data extracted from a database:</p>
  
  <pre><code>["Reports", "UI"]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>0: {ranges: "Low", ph: 0, days: 0}
  1: {ranges: "Mediu,", ph: 0, days: 0}
  2: {ranges: "High", ph: 0, days: 0}
  </code></pre>
  
  <p>I´m showing the second array for each element inside the first array. After that I have an input and also repeat it as i did with the second array</p>
  
  <pre class="lang-html prettyprint-override"><code>    ...
      &lt;tbody *ngFor="let i of paramsData; let y = index"&gt; &lt;---Repeat the data from first array
        &lt;ng-container *ngFor="let data of times; let x = index"&gt; &lt;---Repeat the data from second array in each element in the first array
          &lt;tr&gt;
            &lt;td [attr.rowspan]="times.length" *ngIf="x == 0"&gt;{{i}}&lt;/td&gt;
            &lt;td&gt;{{data.ranges}}&lt;/td&gt;
            &lt;td&gt;
              &lt;input type="number" class="form-control" name='weight'&gt;
            &lt;/td&gt;
            &lt;td&gt;{{data.ph}}&lt;/td&gt;
            &lt;td&gt;{{data.days}}&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/ng-container&gt;
      &lt;/tbody&gt;
      ...
  </code></pre>
  
  <p>QUESTION: How can I get the values introduced in the inputs generated automatically by the <code>*ngFor</code>? I cannot assign a value inside a <code>formControlName</code> because all the inputs will have the same name and only will save one value.</p>
  
  <p>Also, I cannot use the <code>[(ngModel)]="someArray[x]"</code> to stores the values in an array because it only will save the values of the first iteration on the second <code>ngFor</code>.</p>
  
  <p>Am I losing something? Is there an option to do that?</p>
  
  <p><strong>-- EDIT --</strong></p>
  
  <p>Link to StackBlitz: <a href="https://stackblitz.com/edit/angular-ux4cqv" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-ux4cqv</a></p>
  
  <hr>
  
  <p><strong>Screenshot of the table</strong></p>
  
  <p><a href="https://i.stack.imgur.com/gcGRu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gcGRu.png" alt="My table looks like this"></a></p>