I am facing an issue with a service that retrieves user data based on the Token stored in localStorage. The data is returned correctly until it reaches my component.
The problem lies in the code snippet present in my component.ts file: https://i.sstatic.net/IEpvG.png
Even though everything seems to be fine, the console shows that the user property is printed as undefined even after assigning the return value. A screenshot illustrating this can be seen below. https://i.sstatic.net/CIVim.png
When attempting to use the user property in the HTML template, I receive errors indicating that the data cannot be loaded. I have tried using async pipes like (user$ | async) as user and safe navigation like user?.email, but none of these solutions resolved the issue. I am puzzled by this situation and any assistance would be greatly appreciated!