title: How to filter data based on new and old data
body: <p>I am new in angular. I have created an inline editable table that can perform CRUD operation inline.
  The row which I am creating, I made its id with starting key <code>&quot;a&quot;</code> like this</p>
  <pre><code> addNew(): void {
      this.data.push({
        id: &quot;a&quot; + this.newFieldCounter++,
        isEditable: true,
      });
    }
  </code></pre>
  <p>But user click on add button and when he want to cancel the operation, it should remove that new editable row, for that I have written like this:</p>
  <pre><code>cancel(data): void {
      this.data = this.data.filter((x) =&gt; !(x.id === data.id));
      data.isEditable = !data.isEditable;
  }
  </code></pre>
  <p>The cancel button working fine for new rows, but when I am clicking on the edit button of the existing record and when I am clicking on the cancel button, that existing record is also getting removed from the table. :(
  Is there any way to do it?</p>