import { FocusKeyManager } from "@angular/cdk/a11y"; import { Component, Output, TemplateRef, ViewChild, EventEmitter, ContentChildren, QueryList, AfterContentInit, } from "@angular/core"; import { MenuItemComponent } from "./menu-item.component"; @Component({ selector: "bit-menu", templateUrl: "./menu.component.html", exportAs: "menuComponent", }) export class MenuComponent implements AfterContentInit { @ViewChild(TemplateRef) templateRef: TemplateRef; @Output() closed = new EventEmitter(); @ContentChildren(MenuItemComponent, { descendants: true }) menuItems: QueryList; keyManager: FocusKeyManager; ngAfterContentInit() { this.keyManager = new FocusKeyManager(this.menuItems).withWrap(); } }