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

Method text

src/cdk/testing/protractor/protractor-element.ts:195–201  ·  view source on GitHub ↗

* Gets the text from the element. * @param options Options that affect what text is included.

(options?: TextOptions)

Source from the content-addressed store, hash-verified

193 * @param options Options that affect what text is included.
194 */
195 async text(options?: TextOptions): Promise<string> {
196 if (options?.exclude) {
197 return browser.executeScript(_getTextWithExcludedElements, this.element, options.exclude);
198 }
199 // We don't go through Protractor's `getText`, because it excludes text from hidden elements.
200 return browser.executeScript(`return (arguments[0].textContent || '').trim()`, this.element);
201 }
202
203 /**
204 * Sets the value of a `contenteditable` element.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected