Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

How to update data in the menu after the app is initialized?

$
0
0

@fefelegal wrote:

Hi!

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:
1) User is not logged in, app.js requests data to the provider, which returns empty.
2) User logs in, now the provider has the relevant data stored and can provide it when requested
3) 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 :smile: Thank you!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles