@BBenard wrote:
Hi,
In constructor :
I get a free id with an API from a provider in my code.
this.idContact = myProfil.getUserId();
the console.log of my provider tells me that the idContact is known
[ng] [console.log]: "Current user : 8"
then
in ionViewWillEnter
I want to get the data for this user with another API requestionViewWillEnter() { console.log('ionViewDidEnter idContact : ' + this.idContact); this.getUserData(this.idContact); }
But finally, this.idContact is undefined !! Whereas the log just above told me it had a value ?!
[ng] [console.log]: "ionViewDidEnter idContact : undefined"
what’s wrong in this code according to you ?
(maybe should I use promises ? I could need help to do it…)(Note : there is no ‘ionic-v4’ category to post in this forum. I posted in ionic-v3)
Thanks
Posts: 1
Participants: 1