I got the error:
Possibly unhandled rejection: {}
I read the solution in this topic : Angular 1.6.0: "Possibly unhandled rejection" error
i tried But i dont know where i put fixed code, please kindly help me, thanks Thanks all !
I got the error:
Possibly unhandled rejection: {}
I read the solution in this topic : Angular 1.6.0: "Possibly unhandled rejection" error
i tried But i dont know where i put fixed code, please kindly help me, thanks Thanks all !
First option is simply to hide an error by disabling them with errorOnUnhandledRejections
in $qProvider configuration:
app.config(['$qProvider', function ($qProvider) {
$qProvider.errorOnUnhandledRejections(false);
}]);
BUT this will only switch off logging. The error itself will remain
The better solution in this case will be - handling a rejection with .catch()
method:
service.doSomething()
.then(function (response) {
//normal processing
})
.catch(function (err) {
console.log(err);
throw err;
});
Useful Links: