How to wait for the function to return? See Image


#1

Hello,

I need to wait for the subscribe to return the value, however it does not wait and skip …
How can I do it?
I need the “function autoriza” return 1 or 2.

Thank you

image


#2

Sorry, not possible. You can’t return the result of an asynchronous operation synchronously. You must return a Promise or Observable instead.