0
Good morning guys, in my angular project 4 I completed the Adm screen and I wish the header did not appear in it, I know I could do this with ngIf but I’m lost >_>, Can someone give a light? The app module.html looks like this
<app-navbar></app-navbar>
<div style="padding-top:100px" class="container">
<flash-messages></flash-messages>
<router-outlet></router-outlet>
</div>
would like to remove the <app-navbar>
– Bruno Maia
Really the best option in this case would be a
*ngIf
. If you just want to get rid of it without dynamism, you can put<app-navbar *ngIf="true"></app-navbar>
. Now if you want this behavior to occur whenever you do an action you will have to in some method change its value. For example, supposing that(click)="mostrarCabecalho()"
, within this method you must set another variable, for exampleisCabecalho
that will be likefalse
and will pass totrue
. That variable should be in your header, so:<app-navbar *ngIf="isCabecalho"></app-navbar>
– Patrick Lima