如何在ionic 2中删除图像文件系统?

时间:2018-08-23 11:19:04

标签: javascript arrays file ionic-framework ionic2

我正在尝试从图库中删除图像。

显示错误:

  

resolveLocalFileSystemURI的参数“ uri”的类型错误:预期   字符串,但是得到了数组。

代码

let data:Array<{ imgUrl: string, fileName: string }>;
    data = new Array();
    let j = 0;
    for(let test of pathimg){
      data.push({imgUrl:pathimg,fileName:filename[j]+'.png'});
      j++;
    }

for(let test of data){    
    this.file.removeFile(test.imgUrl, test.fileName).then(_ =>
        console.log('deleted succesfully')).catch(err =>
            console.log('cannot delete'));
}

0 个答案:

没有答案