How to update the side menu profile pic after login


#1

How to update the side menu profile pic after login.actually i want to do when user login after that showing the pic inside the side menu.


#2

I think you have to save the pic in your localstorage that is in another page so the pic code in app.component.ts.

Do onething call the method from home.ts in app.components.ts method

See the below url


#3

now showing my pic.but there is one another problem occur.suppose one user logout from the app.after second user when login this time showing the image of previous user.how can i fix it?


#4

when you logout from app you have to remove the localstorage values or clear cache


#5

@narasimham3 i’m doing something like that.

function()

logout(){
     this.storage.clear().then(() => {
     this.navCtrl.setRoot(LoginPage);
    });
  }

but its still showing same image.


#6

this.storage.remove(‘name’).then(() => {
console.log(‘name has been removed’);
});


#7

#8

i’m also try this function.but happen nothing


#9

only pic repeated or name also repeated?

I mean what about names etc…


#10

@narasimham3 both are repeated.


#11

so your cache not removed when you remove your cache then its work
and also the build check in devices(android or ios) not in ionic serve


#12

i’m checking in android.