title: How to get previous data when I click add row dynamically in angular 6?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  addFieldValue() {
         this.newarray= this.fieldArray.push(this.newAttribute)
         console.log(this.newarray);
          this.newAttribute = {};
      }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.10/angular.min.js"&gt;&lt;/script&gt;
    &lt;td&gt;
                &lt;input [(ngModel)]="field.SourceIP" class="form-control" type="text" name="{{field.SourceIP}}" /&gt;
            &lt;/td&gt;
            &lt;button mat-button  (click)="addFieldValue()"&gt;Add More Rule
          &lt;i class="material-icons custom"&gt;add&lt;/i&gt;
  &lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> addFieldValue() {
         this.newarray= this.fieldArray.push(this.newAttribute)
         console.log(this.newarray);
          this.newAttribute = {};
      }
  
      deleteFieldValue(index: number) {
          this.fieldArray.splice(index, 1);
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I am adding dynamic row in my table I can't able to see previous data of row.I  am using Angular 6?</p>
  
  <p>Here I am entering data after the click of add I am losing my previous data after adding a row </p>
  
  <p><img src="https://i.stack.imgur.com/5Pcil.png" alt="enter image description here"></p>