-1
I have a function in Ionic that receives an array from the API and shows the received data
public info;
async showinfo() {
await this.authService.getInfo().subscribe(
data=>{
this.info = data;
console.log(data);
for(let i=0; i<data.length; i++){
this.info[i];
}
},
error=>{
console.log(error);
});
console.log(this.info); //aparece undefined
}
When I give a console.log() inside the subscribe I can see the value I get from the API but if I try to see the value outside of it, it doesn’t show the data. How do I see off the subscribe value of the variable??
thank you very much!!!!
– sadjapa