quick question. I want to trigger Mat-menu on mouse over div element with header of my component, but only when some specific condition is set to true.
I have something like this:
<div class="card-header"
[matMenuTriggerFor]="comp.RejectionDetails ? rejectionDetails : null"
#trigger="matMenuTrigger" (mouseenter)="trigger.openMenu()"
(mouseleave)="trigger.closeMenu()">
<mat-menu #rejectionDetails [class]="'mat-menu-component'"
[hasBackdrop]="false">
<ng-template matMenuContent>
<div>TEST</div>
</ng-template>
</mat-menu>
It's seems to work as expected but in console it's throwing error:
UniversalDynamicComponent.html:10 ERROR Error: matMenuTriggerFor: must pass in an mat-menu instance.
Example: <mat-menu #menu="matMenu"></mat-menu> <button [matMenuTriggerFor]="menu"></button>
I understand that is because of passing null value to directive (when the conidition is false). But I can't figure out other solution for this problem. Maybe someone can help? Thanks!