MCPcopy
hub / github.com/angular/angular / create

Function create

packages/core/src/di/injector.ts:107–119  ·  view source on GitHub ↗
(
    options:
      | StaticProvider[]
      | {providers: Array<Provider | StaticProvider>; parent?: Injector; name?: string},
    parent?: Injector,
  )

Source from the content-addressed store, hash-verified

105 }): DestroyableInjector;
106
107 static create(
108 options:
109 | StaticProvider[]
110 | {providers: Array<Provider | StaticProvider>; parent?: Injector; name?: string},
111 parent?: Injector,
112 ): Injector {
113 if (Array.isArray(options)) {
114 return createInjector({name: ''}, parent, options, '');
115 } else {
116 const name = options.name ?? '';
117 return createInjector({name}, options.parent, options.providers, name);
118 }
119 }
120
121 /** @nocollapse */
122 static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ ɵɵdefineInjectable({

Callers 2

constructorMethod · 0.50
getOrCreateMethod · 0.50

Calls 2

createInjectorFunction · 0.90
isArrayMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…