title: how to refresh ionic 4 list items after deleting an element
body: <p>what I want to do is refresh ionic 4 list items after deleting an element, because i'm getting the error below:</p>
  
  <p>html:</p>
  
  <pre><code> &lt;ion-list [hidden]="showAllStations==false"&gt;
        &lt;ion-item *ngFor="let item of wayPoints; let i = index"&gt;
          &lt;ion-label&gt;{{item.location}}&lt;/ion-label&gt;
          &lt;ion-checkbox slot="start" 
  
          (ionChange)="delete(i)"&gt;&lt;/ion-checkbox&gt;
        &lt;/ion-item&gt;
        &lt;ion-button  type="submit" (click)="deletStations()" expand="block" class="ion-text-center ion-margin-top" &gt;Valide&lt;/ion-button&gt;
  
      &lt;/ion-list&gt;
  </code></pre>
  
  <p>ts:</p>
  
  <pre><code> delete(index){
  
   console.log(index);
   this.deletedStations.push(index);
   // delete this.wayPoints[index];
   console.log(this.deletedStations);
  }
   deletStations(){
    this.deletedStations.forEach(index =&gt; delete this.wayPoints[index]);
    console.log(this.wayPoints);
    this.modalCtrl.dismiss(this.wayPoints);
   }
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>ERROR TypeError: Cannot read property 'location' of undefined
  </code></pre>