Imagine I have a requirement to include a data provider element for my users, like this:
<user-data-provider user-data="{{data}}"></user-data-provider>
This element would send an ajax request to retrieve the logged in user's information.
If I want to access this user data on multiple pages, I could simply add this tag wherever needed. However, the issue is that every time the browser encounters this tag, it triggers another ajax request, causing me to wait for the data to be fetched each time!
I am aware that I could create a variable on my main page and pass it to child pages, but that seems excessive to me!
Is there a way to persist user data across different pages within my application?
Thank you for your assistance.