【问题标题】:Ionic native file opener 2 error class not found找不到离子本机文件打开器 2 错误类
【发布时间】:2018-01-24 11:20:49
【问题描述】:

我在尝试打开文件时收到错误Class not found

.ts

open(){
  this.platform.ready().then(() => {
   this.fileOpener.open(this.entry.nativeURL, this.attachment.mime).then(() => {
    console.log('file opened')
   }, err => {
    console.log('error open file: ', err)
  });
 });
}

this.entry.nativeURL是使用File Transfer的下载结果

nativeURL:file:///storage/emulated/0/Download/someFile.docx

this.fileTransfer.download(url, this.storageDirectory + this.attachment.fileName, trustAllHosts).then((entry) => {
 console.log('entry: ', entry);
 this.entry = entry;
}

this.attachment.mime:application/vnd.openxmlformats-officedocument.wordprocessingml.document

我也试过application/pdf 的pdf文件,没用

【问题讨论】:

    标签: ionic-framework ionic2 cordova-plugins ionic3 ionic-native


    【解决方案1】:

    它的工作...问题在于实时运行应用程序--livereload

    【讨论】:

      猜你喜欢
      • 2018-07-10
      • 2018-01-03
      • 1970-01-01
      • 2017-09-21
      • 1970-01-01
      • 2013-04-02
      • 1970-01-01
      • 2017-11-09
      相关资源
      最近更新 更多