【发布时间】:2019-02-07 22:28:15
【问题描述】:
我不明白为什么该代码不起作用:
this.doMagic() // <- there is a Promise which do 'reject'
.then(_ => {
alert('test 1') // <- this is not working (OK)
})
.catch(_ => {
alert('test 2') // <- it is working (OK)
})
.finally(_ => {
alert('test 3') // <- it is not working (NOT OK)
})
在浏览器中一切正常,但我启动模拟器,“测试 3”不起作用
起初我认为可能是因为警报不起作用。但不是。如果您在 catch 中添加更多警报,它们将正常工作
总的来说,我有两个假设:
1) Cordova 不支持finally
2) 我不明白发生了什么并在某处犯了错误
那么,哪里是真的?
【问题讨论】:
标签: cordova android-emulator cordova-plugins