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

Function getSecondaryText

src/material/list/testing/list-item-harness-base.ts:141–159  ·  view source on GitHub ↗

* Gets the secondary line text of the list item. Null if the list item * does not have a secondary line.

()

Source from the content-addressed store, hash-verified

139 * does not have a secondary line.
140 */
141 async getSecondaryText(): Promise<string | null> {
142 const type = await this.getType();
143 if (type === MatListItemType.ONE_LINE_ITEM) {
144 return null;
145 }
146
147 const [lines, unscopedTextContent] = await parallel(() => [
148 this._lines(),
149 this._unscopedTextContent(),
150 ]);
151
152 // If there is no explicit line for the secondary text, the unscoped text content
153 // is rendered as the secondary text (with potential text wrapping enabled).
154 if (lines.length >= 1) {
155 return lines[0].text();
156 } else {
157 return unscopedTextContent.text();
158 }
159 }
160
161 /**
162 * Gets the tertiary line text of the list item. Null if the list item

Callers

nothing calls this directly

Calls 3

parallelFunction · 0.90
textMethod · 0.65
getTypeMethod · 0.45

Tested by

no test coverage detected