MCPcopy Create free account
hub / github.com/angular/components / onClick

Method onClick

src/aria/private/menu/menu.ts:574–583  ·  view source on GitHub ↗

Handles click events for the menu bar.

(event: MouseEvent)

Source from the content-addressed store, hash-verified

572
573 /** Handles click events for the menu bar. */
574 onClick(event: MouseEvent) {
575 const item = this.inputs.items().find(i => i.element()?.contains(_getEventTarget(event)));
576
577 if (!item) {
578 return;
579 }
580
581 this.goto(item);
582 item.expanded() ? item.close() : item.open();
583 }
584
585 /** Handles mouseover events for the menu bar. */
586 onMouseOver(event: MouseEvent) {

Callers

nothing calls this directly

Calls 6

gotoMethod · 0.95
_getEventTargetFunction · 0.90
expandedMethod · 0.80
openMethod · 0.65
elementMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected