gpt4 book ai didi

typescript - 设置 Ionic 2 Cordova 相机插件

转载 作者:搜寻专家 更新时间:2023-10-30 21:42:48 24 4
gpt4 key购买 nike

 initializeApp(){
this.platform.ready().then(() => {
{
document.addEventListener("deviceready", onDeviceReady, false);
}

function onDeviceReady() {
console.log(navigator.camera);
console.log("Cordova");
}

}

我们正在尝试运行 onDeviceReady 函数,console.log 不会打印出来

最佳答案

 initializeApp(){
this.platform.ready().then(() => {
console.log(navigator.camera);
console.log("Cordova");
}
}

Platform.ready()deviceready 触发时解析,因此无需再次监听它。在这种情况下,在它触发后监听它会导致该处理程序永远不会执行。

关于typescript - 设置 Ionic 2 Cordova 相机插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35302457/

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