我有一个正在使用浏览器的删除功能,但当我ionic upload
并在我的手机上试用它时,它甚至都没有运行它
showConfirm(index) {
let confirm = this.alertCtrl.create({
title: 'Delete Lay Minister',
message: 'Are you sure you want to delete this lay minister?',
buttons: [
{
text: 'Disagree',
handler: () => {
}
},
{
text: 'Agree',
handler: () => {
this.doDelete(index);
}
}
]
});
confirm.present();
}
这是删除功能,根本不运行,但警报将运行
doDelete(index){
let id = this.layMinisters[index].id;
this.layMinisterProvider.deleteLayMinister(id).subscribe(
res => {
this.presentToast();
this.layMinisters.splice(index, 1);
}
);
}
修改::
Lay Minister Provider
deleteLayMinister(id): Observable<any>{
return this.http.delete(
this.api.url() + '/faith-leader/' + 'lay-minister/' + id + '/delete',
{
headers: new Headers({ "Authorization": "Bearer " + this.access_token })
}
);
}