Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic framework 无法删除值存储区3_Ionic Framework - Fatal编程技术网

Ionic framework 无法删除值存储区3

Ionic framework 无法删除值存储区3,ionic-framework,Ionic Framework,我想删除Ionic3存储中的值,但无法: item是站点的id removeItem(item){ this.storage.get('thestations').then((val) => { for(var i = 0; i < val.length; i++) { if(val[i].id == item) { this.storage.remove(

我想删除Ionic3存储中的值,但无法: item是站点的id

removeItem(item){

     this.storage.get('thestations').then((val) => {

            for(var i = 0; i < val.length; i++) 
            {

              if(val[i].id == item) {
                 this.storage.remove(i);
              }
            } 
        });
    }
removietem(项目){
this.storage.get('thestations')。然后((val)=>{
对于(变量i=0;i
我还尝试删除键号为5的行,但仍然存在相同的问题:
this.storage.remove('5')

首先,存储是一个键值存储。因此,当您要删除整个项目时,需要调用storage.remove(键) 但是,当您存储了一个数组并想要删除一个项目时,您需要首先获取该数组,修改它,然后再次保存它

无法对存储引用进行操作/删除