splice method in ion-list, list get refreshed but the delete button still shown
<p>I have a list of data that populates an ionic list with delete function when we swipe the list to left.</p>

<p>I am able to make the delete function to work, however after the success response and the list get refreshed, the delete button still shown in the index that we clicked before.</p>

<p>I am using <code>$scope.data.splice($index, 1);</code></p>

<p>this is my code</p>

<p><strong>HTML</strong></p>

<pre><code>&lt;ion-pane&gt;
  &lt;ion-view view-title="Incoming list"&gt;
    &lt;ion-nav-buttons side="right"&gt;
      &lt;a class="button" href="#/app/fg-in-add"&gt;
        &lt;i class="icon ion-plus"&gt;&lt;/i&gt;
      &lt;/a&gt;
      &lt;a class="button" href="#/app/scanner-fg-in"&gt;
        &lt;i class="icon ion-qr-scanner"&gt;&lt;/i&gt;
      &lt;/a&gt;
    &lt;/ion-nav-buttons&gt;

    &lt;ion-content class="has-header"&gt;
      &lt;div class="list"&gt;
        &lt;div class="item item-input-inset"&gt;
          &lt;label class="item-input-wrapper"&gt;
            &lt;i class="icon ion-search placeholder-icon"&gt;&lt;/i&gt;
            &lt;input type="text" ng-model="fgin.search" class="textUppercase"&gt;
          &lt;/label&gt;
          &lt;button class="button button-small"&gt;
            &lt;i class="icon ion-search"&gt;&lt;/i&gt; Search
          &lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;ion-list show-delete="false" can-swipe="true"&gt;
        &lt;ion-item ng-repeat="x in data track by $index" class="item-remove-animate"&gt;
          &lt;!-- &lt;ion-option-button class="button-positive icon ion-edit" on-touch="deleteFGin({{x.mif_no}})"&gt;&lt;/ion-option-button&gt; --&gt;
          &lt;ion-option-button class="button-assertive icon ion-trash-a" on-touch="Delete(x.mif_no,x.item_no,$index); x.deleted = true;"&gt;&lt;/ion-option-button&gt;
          &lt;h3&gt;&lt;i class="icon ion-android-apps"&gt;&lt;/i&gt; {{x.mif_no}} &lt;i class="icon ion-ios-arrow-thin-right"&gt;&lt;/i&gt; {{x.item_no}}&lt;/h3&gt;
          &lt;hr /&gt;
          &lt;div class="descr"&gt;&lt;i class="icon ion-grid"&gt;&lt;/i&gt; &lt;span class="judul"&gt;{{x.part_no}}&lt;/span&gt; &lt;i class="icon ion-ios-arrow-thin-right"&gt;&lt;/i&gt; {{x.part_name}}&lt;/div&gt;
          &lt;div class="descr indentlitte"&gt;{{x.qty}} {{x.u_measure}}&lt;i class="icon ion-ios-arrow-thin-right"&gt;&lt;/i&gt; {{x.rack_no}}&lt;/div&gt;
          &lt;span class="badge badge-clear"&gt;{{x.date}}&lt;/span&gt;
        &lt;/ion-item&gt;
      &lt;/ion-list&gt;
    &lt;/ion-content&gt;

  &lt;/ion-view&gt;
&lt;/ion-pane&gt;
</code></pre>

<p><strong>JS</strong></p>

<pre><code>$scope.Delete = function(docno,itemno,index){
  $http({
    method: "post",
    url: apiServer + "/fg-in-del.php",
    data: {
      mifno: docno,
      itemno: itemno,
      Dbserver: window.localStorage.getItem("server"),
      Dbuser: window.localStorage.getItem("username"),
      Dbpass: window.localStorage.getItem("password"),
      Dbname: window.localStorage.getItem("dbname"),
    },
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  }).then(function(response) {
    if (response.data == 1){
      var alertPopup = $ionicPopup.alert({
        title: 'Delete',
        template: 'Data has been deleted.'
      });
      $scope.data.splice(index, 1);
    }else {
      var alertPopup = $ionicPopup.alert({
        title: 'Delete',
        template: 'Failed to delete data.'
      });
      console.log(response.data);
    }
  }, function(response) {
    $scope.data=response.data;
    var alertPopup = $ionicPopup.alert({
      title: 'Delete',
      template: 'Failed to delete data.'
    });
  });
}
</code></pre>