У меня есть динамический array полный элементов и значений. Когда пользователь нажимает кнопку на элементе, он должен удалить элемент из списка. Я все догадываюсь, почему это так. Будут ли данные структурированы? Я бы не подумал, потому что это показывает, что он удаляется в консоли. В любом случае спасибо!
TS:
export class Page{
    items: Item[];
    constructor(public alertCtrl: AlertController){}
    removeitem(i) {
        let confirm = this.alertCtrl.create({
            title: 'Confirm',
            message: "text.",
            buttons: [
                {
                    text: 'Cancel',
                    handler: () => {
                        console.log('Disagree clicked');
                    }
                },
                {
                    text: 'Save',
                    handler: () => { 
                        this.presentToast() 
                        this.items.splice(i, 1);
                    }
                }
            ]
        });
        confirm.present();
    }
getItems(){
   this.stopService.getItems().subscribe(item => { 
     this.items = item 
  })
  }
}
HTML:
<div *ngFor="let item of items; index as i ">
    <h3>{{item.description}}</h3>
    <button item-end ion-button full (click)="removeitem(i)">remove item</button>
</div>
ИЗМЕНИТЬ
добавление сервиса, как я получаю элементы -
getItems(): Observable<any> {
         return this.http.get(someEndpoint)
        .map(res => res.json());
    }