I have a header component , a footer component , Nav component and Content component on a Page.
<sa-header></sa-header>
<sa-navigation></sa-navigation>
<div id="main" role="main">
// I have put Profile page here using routing and I have First name and last name on profile page
<router-outlet></router-outlet>
</div>
<sa-footer></sa-footer>
Now in router-outlet, I have put a profile page using routing with first name and last name and based on first name and last name of profile page I want to display that name in Header component.
In Header page I have below code:
<div> <span>{{user.displayName }}</span> <i class="fa fa-angle-down"></i></div>
I try with below link but not useful in my case.
Angular 2 - Update @input value of component on click on different component
Angular 2/TypeScript: @Input/@output or input/output?
I also try get and set those name in session but my header page load first so once I change in profile page it dose not effect header page.
How to change name in header page?