In the login page, I enter my username -> test1
After the connection, I have the login page and the dashboard displayed at the same time.
The login page should disappear after login.
app.component.html
<app-login></app-login>
<app-dashboard-layout [configuration]="configuration">
<div container="sidePanel" *ngIf="currentUser">
<app-navigation-side-panel [links]="links"></app-navigation-side-panel>
</div>
<div container="navigationBar" *ngIf="currentUser">
<app-navigation-bar></app-navigation-bar>
</div>
<div container="mainContent">
<div *ngIf="currentUser">
<a style="color: black" (click)="logout()">Logout </a>
<router-outlet></router-outlet>
</div>
</div>
</app-dashboard-layout>
I think the problem is below:
<app-login></app-login>
Here is a simulation -> here
I don't know where is the problem?
CodePudding user response:
You don't need to put <app-login></app-login> in app.component.html file.
Here is a right code.
<app-dashboard-layout [configuration]="configuration" *ngIf="currentUser">
<div container="sidePanel">
<app-navigation-side-panel [links]="links"></app-navigation-side-panel>
</div>
<div container="navigationBar" *ngIf="currentUser">
<app-navigation-bar></app-navigation-bar>
</div>
<div container="mainContent">
<div>
<a style="color: black" (click)="logout()">Logout </a>
</div>
</div>
</app-dashboard-layout>
<router-outlet></router-outlet>
