title: How to take value from input which is in *ngFor loop
body: <p>The problem is that we have to take values that are under *ngFor loop so, it's taking value that is coming from the first input. We have to sore value in an array that is coming from the value of inputs.</p>
  <p><strong>HTML</strong></p>
  <pre><code>&lt;div *ngFor=&quot;let ele of container&quot;&gt;
    &lt;div *ngIf=&quot;keyValue === ''&quot;&gt;
      &lt;input type=&quot;text&quot; [(ngModel)]=&quot;keyValue&quot; /&gt;
      &lt;textarea
        name=&quot;&quot;
        id=&quot;&quot;
        cols=&quot;30&quot;
        rows=&quot;10&quot;
        [(ngModel)]=&quot;textValue&quot;
      &gt;&lt;/textarea&gt;
    &lt;/div&gt;
    &lt;button (click)=&quot;addContainer()&quot;&gt;Add More&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  <p><strong>.ts File</strong></p>
  <pre><code>import { Component, OnInit } from '@angular/core';
  
  @Component({
    selector: 'app-sample',
    templateUrl: './sample.component.html',
    styleUrls: ['./sample.component.css'],
  })
  export class SampleComponent implements OnInit {
    constructor() {}
    container: any[] = [0];
    keyValue: String = '';
    textValue: String = '';
    newArray: any = [];
    ngOnInit(): void {}
  
    addContainer() {
      this.newArray.push({ key: this.keyValue, values: this.textValue });
      console.log(this.newArray);
  
      this.container.push(this.container.length);
      console.log(this.container);
    }
  }
  </code></pre>