2
all right? I’m having trouble making http requests on my Angular CLI project.
When I use this.http.post(url, dados, config).subscribe(ret => this.retorno = ret)
and then I give console.log(this.retorno)
he returns Undefined.
I think it’s something about "asynchrony," because if I put a SetTimeout()
in this.log console it shows the correct post return.
Do I have to do any treatment on that requisition? What I can do to ensure that execution will only continue when this request is completed?
I spent a whole day looking around, nowhere have I seen special treatment in these requisitions, something so simple that I’m wasting a lot of time, I’m already going crazy with this.
Thanks Edgar, I have to get used to these asynchronous requisitions.
– Diego Felisberto