I am working on a shopping site. in that header and footer is fixed in app.component.ts, but router-outlet is dynamic. user login in header and cart tab in header component when I have a login from login component (router-outlet) it's working but in the header, the username is not showing because I have saved some user data in local storage of web browser. data is saving in that but after successful login, it's not showing username from local storage. but when I have refreshed manually then the username is showing. I have many similar issues for like cart item, order etc.