MCPcopy Index your code
hub / github.com/angular/components / _setRole

Method _setRole

src/cdk/menu/menu-trigger.ts:368–374  ·  view source on GitHub ↗

Sets the role attribute for this trigger if needed.

()

Source from the content-addressed store, hash-verified

366
367 /** Sets the role attribute for this trigger if needed. */
368 private _setRole() {
369 // If this trigger is part of another menu, the cdkMenuItem directive will handle setting the
370 // role, otherwise this is a standalone trigger, and we should ensure it has role="button".
371 if (!this._parentMenu) {
372 this._elementRef.nativeElement.setAttribute('role', 'button');
373 }
374 }
375
376 /** Sets thte `type` attribute of the trigger. */
377 private _setType() {

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected