Getting error on ionic cordova build android

时光怂恿深爱的人放手 提交于 2019-12-01 20:09:31

According to the error message, you have not handled a rejection on one of your Promise objects. Each and every promise is expected to have a .catch(...).

var flag = false;
var Test = function () {
return new Promise(function (resolve, reject) {
if (flag === true)
    resolve();
else
    reject();
});
}
var testFunc = Test();
testFunc.then(function () {
 alert("Promise Resolved");
});
testFunc.catch(function () {
 alert("Promise Rejected");
});

Read more about Promise Objects here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!