Skip to content

Commit

Permalink
Fix MegaMenu in jest using forwardRef
Browse files Browse the repository at this point in the history
  • Loading branch information
vespertilian committed Sep 27, 2023
1 parent 396297a commit 0bc0813
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/components/megamenu/megamenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
ViewChild,
ViewEncapsulation,
effect,
forwardRef,
signal
} from '@angular/core';
import { RouterModule } from '@angular/router';
Expand Down Expand Up @@ -226,7 +227,7 @@ export class MegaMenuSub {

@ViewChild('menubar', { static: true }) menubarViewChild: ElementRef;

constructor(public el: ElementRef, public megaMenu: MegaMenu) {}
constructor(public el: ElementRef, @Inject(forwardRef(() => MegaMenu)) public megaMenu: MegaMenu) {}

onItemClick(event: any, processedItem: any) {
this.getItemProp(processedItem, 'command', { originalEvent: event, item: processedItem.item });
Expand Down

0 comments on commit 0bc0813

Please sign in to comment.