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

Function loadExample

src/components-examples/private/load-example.ts:11–23  ·  view source on GitHub ↗
(
  name: string,
  injector: Injector,
)

Source from the content-addressed store, hash-verified

9 * entry-points for the example modules under the `<host>/bundles/` URL.
10 */
11export async function loadExample(
12 name: string,
13 injector: Injector,
14): Promise<{component: Type<any>; injector: Injector}> {
15 const {componentName, importPath} = EXAMPLE_COMPONENTS[name];
16 const moduleExports = await import(`/bundles/components-examples/${importPath}/index.js`);
17 const componentType: Type<any> = moduleExports[componentName];
18
19 return {
20 component: componentType,
21 injector,
22 };
23}

Callers 2

ngOnInitMethod · 0.90
_exampleChangedMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected