Skip to content
Advertisement

Ionic 3 Uncaught (in promise): [object Object]

I am new to Ionic 3 and mobile development. I am trying to connect a MySQL DB to my Ionic app and a PHP Restful API. I tested the API with Postman and it is working just fine, in order to implement it in Ionic I did the following, I first made a provider named Authservice:

JavaScript

And a Signup page:

JavaScript

When running this I am getting an Uncaught (in promise): [object Object] error as can be seen here.


UPDATE

I am now getting the following error:

JavaScript

Advertisement

Answer

You can make use of Typescript’s async methods to make your life easier

Your postData method in async

AuthServiceProvider:

JavaScript

Signup page:

JavaScript

Don’t forget to import toPromise operator in AuthServiceProvider

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement