I have try to reload page when same Url Routes Call in Angular 6, But it can be Reload Page
Like i am in Home page and Home Page Contain Home Page link so i Click on that link Page will be Reload.
I used Angular 6 and i have try following things
My Routes :
const routes: Routes = [
{ path: '', component: FrontComponent,runGuardsAndResolvers: 'always' },
{ path: 'admin', component: AdminComponent }
];
Routes Link :
@NgModule({
imports: [ RouterModule.forRoot(routes, {onSameUrlNavigation: 'reload'}) ],
exports: [ RouterModule ]
})
Html Code :
<ul>
<li><a href="javascript:void(0);" (click)="homePage();">Home</a></li>
<li><a [routerLink]="['']">Home</a></li>
<li><a href="javascript:void(0);" (click)="clearData();">Clear</a></li>
</ul>
Updated Html Code :
<li class="nav-item" *ngIf=isFrontLogin>
<a class="nav-link" >My Account</a>
</li>
<li class="nav-item" *ngIf=isFrontLogin>
<a class="nav-link" href="javascript:void(0);" (click)="logout()">Log Out</a>
</li>
i have used onSameUrlNavigation
on Routes
But it cant be help
Comments
Post a Comment