Gets the text label of the list option. Used for the typeahead functionality in the list.
()
| 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 { |