How to wait for the function to return? See Image

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

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

1 Like