User avatar in sidemenu after login

I am trying to set user avatar (url to image) after user login in sidemenu. All data are store in localstorage after login - included avatar url.

But I am not able to change variable for avatar url in App component from Welcome component after login to change the image…

What is the best practice for this please?

Thanks a lot


Publish an event after user logged in and consume the same app.component.ts.
Login Page:
import { Events } from ‘ionic-angular’;
add public events: Events in your constructor.
add‘userloggedin’); in your login process
in your app.component.ts
import { Nav, Platform,Events } from ‘ionic-angular’;
add public events: Events in your constructor. add below constructor

// this event subscribe is used to load dynamic menu‘userloggedin’,(() => {console.log(‘event received’);
this.getMenuOptions(); }));

Can I ask, what you have it function getMenuOptions()?

In my case, Side menu options are dynamic from server, based on logged in user role