How to hide cdkMenu without outside click?

73 Views Asked by At

I have "add location" button, which opens cdkMenu

<button class="btn btn--add" cdkMenuItem [cdkMenuTriggerFor]="locationAdd">
<ng-template #locationAdd>
    <div class="menu-panel" cdkMenu></div>
</ng-template>
</button>

Now I want close cdkMenu in my ts file like the right click. I've tried

@ViewChild('locationAdd') locationAdd: CdkContextMenuTrigger;

But it doesnt help.

0

There are 0 best solutions below