I have some content on the left menu that can only be displayed after the user is logged in. Currently the menu sits in the app.html and the data comes from the app.js, which is processed only when the app runs for the first time.
The problem is that after the user goes through a login page I have extra data, but how do I make the app.js aware of this? I’m using a provider for all the data and this is how I see it happening:
- User is not logged in, app.js requests data to the provider, which returns empty.
- User logs in, now the provider has the relevant data stored and can provide it when requested
- Problem: app.js already made the request at the beginning and stored the empty data to its instance, so nothing will appear in the menu.
How do I make the app.js fetch new data from the provider once the user logs in? Or the only way to solve this is putting the menu somewhere else outside app.html?
Hopefully I made the problem clear enough Thank you!