PerfectMemory / ngx-contextmenu

A context menu component for Angular
https://perfectmemory.github.io/ngx-contextmenu
MIT License
42 stars 12 forks source link

contextMenUtem - let-value not work #30

Closed RGerhardt-Pressmind closed 1 year ago

RGerhardt-Pressmind commented 1 year ago

I have the problem that let-value does not contain a value. It is an object, not a string, which in turn is supposed to have the value mobile filled, which it does not. value is apparently null.

What am I doing wrong or is this an error?

<context-menu #contactPersonContextMenu> <ng-template contextMenuItem let-value (execute)="openEmail('tel:'+$event.value.mobile)" [visible]="visibleMobile"> Anrufen Mobil ({{value?.mobile}}) </ng-template> </context-menu>

sroucheray commented 1 year ago

Hi @RGerhardt-Pressmind,

Did you set the [contextMenuValue] attribute's value on the [contextMenu] directive ?

image

https://perfectmemory.github.io/ngx-contextmenu/?path=/docs/context-menu-documentation-in-a-nutshell--docs

RGerhardt-Pressmind commented 1 year ago

@sroucheray Yes, i have set Greenshot 2023-08-29 09 31 34

sroucheray commented 1 year ago

Hummm.... Sorry to ask, but could you provide a minimum reproduction of the problem on a stackblitz please ?

RGerhardt-Pressmind commented 1 year ago

@sroucheray Here can you this reproduce:

https://stackblitz.com/edit/stackblitz-starters-ttbvtv?file=src%2Fmain.ts

{{value?.mobile}} is the value, but value is undefined

sroucheray commented 1 year ago

You spoted a bug. This should be fixed in 16.0.2 https://stackblitz.com/edit/stackblitz-starters-svke3h?file=src%2Fmain.ts

Can you check that it is good for you ?

RGerhardt-Pressmind commented 1 year ago

Yes, this is a perfect solution. Thank you very much 👍🏻