ngx-contextmenu icon indicating copy to clipboard operation
ngx-contextmenu copied to clipboard

Angular 9 - Can't resolve all parameters for ContextMenuContentComponent

Open silkcom opened this issue 5 years ago • 2 comments

Describe the bug After upgrading to Angular 9 it seems like the @angular/core - Renderer function is not being passed into ContextMenuContentComponent somehow

I'm getting the error: Error: Can't resolve all parameters for ContextMenuContentComponent: ([object Object], [object Object], [object Object], ?).

silkcom avatar Mar 30 '20 16:03 silkcom

In my case I am not getting any error related to ngx-contextmenu, instead, it shows empty menu on right-click, it is like empty 2px height div.

update1: The ngx-contextmenu seems to work in Angular 9.1.0 just fine. However, there seem to be some changes, in angular8 my code used to work just fine this way:

<context-menu *ngIf="tableConfig?.hasInlineActions===true">
  <div *ngFor="let action of tableConfig?.actions" >
        <ng-template contextMenuItem>
            <i *ngIf="action.icon" class="{{action.icon}}"></i>&nbsp;
            {{action.label}}
        </ng-template>
    </div>
</context-menu>

However, when upgraded to Angular9, the menu works only if I remove the DIV inside the context-menu, but this way I will lose the ability to iterate over an array or menu items!

update2: All good, ngx-contextmenu is working just fine on my Angular 9.1.0 project. I am using the latest version 5.4.0. My code looks like this now:

<context-menu *ngIf="tableConfig?.hasInlineActions===true">
  <ng-template *ngFor="let action of tableConfig?.actions" contextMenuItem (execute)="fire_context_action($event.item,action.name)" [visible]="action.inline && action.inline==true && ( action.acl && auth.has(action.acl) )">
      <i *ngIf="action.icon" class="{{action.icon}}"></i>&nbsp;
      {{action.label}}
  </ng-template>
</context-menu>

hasanenalbana avatar Mar 31 '20 14:03 hasanenalbana

facing same issue as @silkcom facing here is my config in angular 9.x "<li *ngFor="let item of items" [contextMenu]="basicMenu" [contextMenuSubject]="item">{{item?.name}}"

brijeshpant83 avatar Aug 13 '20 12:08 brijeshpant83