I have been able to successfully hide the div tag using the code below.
Html file
<mat-toolbar style="position: fixed;" *ngIf="div1" >
<mat-toolbar-row>
<div class="input-group has-search">
<input class="form-control py-2 rounded-pill mr-1 pr-5" placeholder="Search">
</div>
</mat-toolbar-row>
</mat-toolbar>
<button (click)="home()></button>
Ts file
div1:boolean=true;
home()
{
this.div1=false;
}
However, there is a visible space remaining due to the fixed position of the toolbar. How can I change the toolbar position to relative in the "home()" method?