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

Method onClick

src/aria/private/menu/menu.ts:558–567  ·  view source on GitHub ↗

Handles click events for the menu bar.

(event: MouseEvent)

Source from the content-addressed store, hash-verified

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