I have a google map on my project, I have made control position for the button like this:
map: any;
mapReady(event: any) {
this.map = event;
this.map.controls[google.maps.ControlPosition.TOP_LEFT].push(document.getElementById('open'));
this.map.controls[google.maps.ControlPosition.TOP_CENTER].push(document.getElementById('Settings'));
}
I have buttons like this:
<button mat-mini-fab class="shadow bg-light" style="margin-top: 10px !important;" [hidden]="hideOpen" id="open"
(click)="openbtn()" *ngIf="open_btn">
<mat-icon>menu</mat-icon>
</button>
<button mat-mini-fab class="shadow bg-info" style="margin-top: 10px !important; margin-left: 30px;"
[hidden]="hideSettings" id="Settings" *ngIf="!open_btn">
<mat-icon class="text-white">4k</mat-icon>
</button>
Initially, the first button will be visible, second is hidden, when I click on the first button I should display the second button.
I have tried this:
open_btn: boolean = true;
close_btn: boolean = false;
openbtn(){
this.open_btn = false;
this.close_btn = true;
}
*ngIfor[hidden]attribute. If you're using both, then both need to adjusted to show the element. So in the event handler you also need to includehideSettings = false.