gpt4 book ai didi

javascript - Ionic FileUploadOptions 未定义

转载 作者:行者123 更新时间:2023-11-30 15:54:41 24 4
gpt4 key购买 nike

ionic.bundle.js:26771 ReferenceError: FileUploadOptions is not defined

即使安装了 Cordova 文件,我仍然收到此错误:

cordova-plugin-file

cordova-plugin-file-transfer

并且在添加 DeviceReady() 之后:

document.addEventListener('deviceready', function() { 
angular.bootstrap(document, ['starter']);
}, false);
angular.module('starter', ['ionic', 'ngCordova','starter.controllers'])

我的代码

..
$scope.upload = function() {


console.log('2');
$ionicLoading.show({template: 'Loading...'});
console.log('3');
var fileURL = $scope.test;
console.log('4', fileURL);
var options = new FileUploadOptions();
console.log('5');
..

有什么想法吗?

最佳答案

您需要在真实设备中进行测试,并在本地服务中分配本地 ip 地址。

根据您的评论,您在浏览器中尝试,因为您想要调试您的应用程序并且您使用的是 IOS 平台。

所以要测试 ios 的真实设备,您只需要遵循:

Debug real ios device

要测试真实设备 android,您需要在 andorid 中运行您的应用程序,并保持该设备与您的机器连接,在 chrome 中,您只需转到 chrome://inspect/#devices 在那里您可以找到您的设备中的应用程序,您只需要在那里进行检查,您也可以调试您的 Android 应用程序。

我知道它已经对你有很大帮助,但我在这里添加答案,这样其他人也可以得到解决方案。 :)

快乐编码。

干杯..

关于javascript - Ionic FileUploadOptions 未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38765166/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com