* Gets the secondary line text of the list item. Null if the list item * does not have a secondary line.
()
| 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 |