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

Function harnessLoaderForOptional

src/cdk/testing/harness-environment.ts:211–214  ·  view source on GitHub ↗

* Gets a `HarnessLoader` instance for an element under the root of this `HarnessEnvironment`. * @param selector The selector for the root element. * @return A `HarnessLoader` rooted at the first element matching the given selector, or null if * no matching element is found.

(selector: string)

Source from the content-addressed store, hash-verified

209 * no matching element is found.
210 */
211 async harnessLoaderForOptional(selector: string): Promise<HarnessLoader | null> {
212 const elements = await this.getAllRawElements(selector);
213 return elements[0] ? this.createEnvironment(elements[0]) : null;
214 }
215
216 /**
217 * Gets a list of `HarnessLoader` instances, one for each matching element.

Callers

nothing calls this directly

Calls 2

getAllRawElementsMethod · 0.45
createEnvironmentMethod · 0.45

Tested by

no test coverage detected