So i have an angular4 app using import {RouterModule, Routes } from '@angular/router'
my routes config is set up like that :
const appRoutes: Routes = [
{path: '', redirectTo: 'home', pathMatch: 'full',canActivate: [AuthGuard]},
{path:'login', component:LoginComponent},
{path:'home', component:HomeComponent, canActivate: [AuthGuard]},
{path:'profile', component:UserProfileComponent, canActivate: [AuthGuard] },
{path:'record', component:RecordComponent, canActivate: [AuthGuard]},
]
in my navigation bar html im using
<ul class="navbar-nav ml-auto">
<li class="nav-item" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact: true}">
<a [routerLink]="['/home']" class="nav-link"><i class="fas fa-home fa-2x"></i></a>
</li>
<li class="nav-item" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact: true}">
<a [routerLink]="['/profile']" class="nav-link"><i class="fas fa-user fa-2x"></i></a>
</li>
</ul>
to route between my pages. The problem is, every time i click on a link in the nav-bar, the new page does appear, but it is on top of the previous one, i mean if i scroll down i can see the previous page (But the navbar is not duplicated)
not sure if this is relevent but i'm using <router-outlet>
inside my app-component.html