Hi there, I've encountered an issue with my getData() function in accountService.ts. I'm attempting to fetch user data and user account data simultaneously using a zip promise. Although the resolve works correctly and I receive the accurate data, I am facing a problem where the local variables I set to store the returned values always end up as undefined. My intention is to be able to use these variables in other functions.
getData(){
zip(this.getUser(), this.getAccount()).toPromise().then(data =>{
this.user = data.values[0];
console.log(this.user);
this.account = data.values[1];
resolve(data.values[0],data.values[1]);
});
}
I'm working with Angular 8 using typescript.
Thank you!