I have a simple log-in component just like the pic below:
I have a mat-sidenav component to navigate through components. This is an example of my mat-sidenav:
<mat-toolbar class="mat-elevation-z8">
<button mat-icon-button *ngIf="sidenav.mode === 'over'" (click)="sidenav.toggle()">
<mat-icon *ngIf="!sidenav.opened">
menu
</mat-icon>
<mat-icon *ngIf="sidenav.opened">
close
</mat-icon>
</button>
<a routerLink="/home">
</a>
</mat-toolbar>
<mat-sidenav-container>
<mat-sidenav #sidenav="matSidenav" class="mat-elevation-z8">
<h4 class="name">Juan Perez</h4>
<p >Chef</p>
<mat-divider></mat-divider>
<a mat-button class="menu-button" data-toggle="collapse" href="#collapseColaboradores" role="button" aria-expanded="false" aria-controls="collapseColaboradores">
<mat-icon>person</mat-icon>
<span>Pacientes</span>
</a>
<div class="collapse" id="collapseColaboradores">
<li>
<a class="nav-links-menu" routerLink="/formulariopaciente/nuevo">
<i class="fa fa-caret-right"></i><span class="link-text-menu">Formulario Pacientes</span>
</a>
</li>
<li>
<a class="nav-links-menu" routerLink="/busquedapaciente/busqueda">
<i class="fa fa-caret-right"></i>
<span class="link-text-menu">Ingreso Pacientes</span>
</a>
</li>
<li>
<a class="nav-links-menu" routerLink="/listapacientes">
<i class="fa fa-caret-right"></i>
<span class="link-text-menu">Ingresos Diarios</span>
</a>
</li>
</div>
<mat-divider></mat-divider>
<button mat-button class="menu-button">
<mat-icon>help</mat-icon>
<span>Help</span>
</button>
</mat-sidenav>
<mat-sidenav-content>
<div class="content">
<router-outlet></router-outlet>
</div>
</mat-sidenav-content>
What I'm trying to achieve is to hide the sidenav and the toolbar when I'm in the login component. Placing app-sidenav on app.component.html shows the login with both bars (I assume it's because I have the router-outlet inside the mat-sidenav-content) but I don't know another way to achieve this. I actually have 2 components (login and other one) where I need them hidden...I'm trying to think a better way but I don't find any solution :(.
Thanks !!
