I have an Angular 2 application created with Angular cli, my app.component.html look like this :
<app-navigation></app-navigation>
<app-top-navbar></app-top-navbar>
<router-outlet></router-outlet>
<app-footer></app-footer>
<app-right-sidebar></app-right-sidebar>
In my routes i have this condition that tells angular to redirect to /Login if no token is registered in localStorage :
canActivate(): boolean {
if (!localStorage.getItem('token')) {
this.router.navigate(['/login']);
return false;
}
return true;
}
This works perfectlly, but my problem is that i would like to display the /Login (LoginComponent ) not is this router outlet with the sidebar, menu and footer, but in its own router-oulter without the other components.
Any idea on how to do it ?