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

Method getLabel

src/material/list/list-option.ts:220–226  ·  view source on GitHub ↗

Gets the text label of the list option. Used for the typeahead functionality in the list.

()

Source from the content-addressed store, hash-verified

218
219 /** Gets the text label of the list option. Used for the typeahead functionality in the list. */
220 getLabel() {
221 const titleElement = this._titles?.get(0)?._elementRef.nativeElement;
222 // If there is no explicit title element, the unscoped text content
223 // is treated as the list item title.
224 const labelEl = titleElement || this._unscopedContent?.nativeElement;
225 return labelEl?.textContent || '';
226 }
227
228 /** Whether a checkbox is shown at the given position. */
229 _hasCheckboxAt(position: MatListOptionTogglePosition): boolean {

Callers

nothing calls this directly

Calls 1

getMethod · 0.65

Tested by

no test coverage detected