I have two buttons on the main view: Login and Logout. Initially only Login button is shown:
...
<button type="button" routerLink="/login" routerLinkActive="active" class="btn btn-info">Login</button>
<button type="button" routerLink="/showlist" routerLinkActive="active" class="btn btn-info" (click)="logout()">Logout</button>
<router-outlet></router-outlet>
Login button will display a sub-view, once user is authenticated there, I want to pass the result back to main view, if user is authenticated, I want to hide the 'Login' button and show the 'Logout' button.
How can I pass the data from a sub-view back to main view via 'router-outlet'?