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

Method onClick

src/aria/private/menu/menu.ts:555–564  ·  view source on GitHub ↗

Handles click events for the menu bar.

(event: MouseEvent)

Source from the content-addressed store, hash-verified

553
554 /** Handles click events for the menu bar. */
555 onClick(event: MouseEvent) {
556 const item = this.inputs.items().find(i => i.element()?.contains(_getEventTarget(event)));
557
558 if (!item) {
559 return;
560 }
561
562 this.goto(item);
563 item.expanded() ? item.close() : item.open();
564 }
565
566 /** Handles mouseover events for the menu bar. */
567 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