Skip to content

Commit

Permalink
Merge pull request #13759 from vespertilian/megamenu-fix
Browse files Browse the repository at this point in the history
Fix MegaMenu in jest using forwardRef
  • Loading branch information
cetincakiroglu authored Sep 27, 2023
2 parents e3a643c + 0bc0813 commit df9308f
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

1 comment on commit df9308f

@vercel
Copy link

@vercel vercel bot commented on df9308f Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.