【发布时间】:2019-12-13 17:19:24
【问题描述】:
我实际上是在尝试删除本地存储中的精确数据,我尝试使用 splice,但我不确定它是否像这样工作,你有什么想法吗?
this.nativeStorage.getItem('AccepterPart').then(res => {
for (let i of (JSON.parse(res))) {
if (i['HISTO_N'] == this.currentNumInter) {
i['HISTO_Objet2'] = '106';
this.tabEffectuer.push(i);
}
var p = JSON.parse(res);
var ind = p.findIndex(i => i['HISTO_N'] === this.currentNumInter);
var inde = p.filter(i => i.HISTO_N !== this.currentNumInter);
p.splice(inde);
this.nativeStorage.setItem('AccepterPart', JSON.stringify(p));
}
this.nativeStorage.setItem('EffectuerPart', JSON.stringify(this.tabEffectuer));
});
【问题讨论】:
标签: angular typescript cordova ionic4 cordova-nativestorage