MCPcopy
hub / github.com/nestjs/nest / addInjectable

Method addInjectable

packages/core/injector/container.ts:272–283  ·  view source on GitHub ↗
(
    injectable: Provider,
    token: string,
    enhancerSubtype: EnhancerSubtype,
    host?: Type<Injectable>,
  )

Source from the content-addressed store, hash-verified

270 }
271
272 public addInjectable(
273 injectable: Provider,
274 token: string,
275 enhancerSubtype: EnhancerSubtype,
276 host?: Type<Injectable>,
277 ) {
278 if (!this.modules.has(token)) {
279 throw new UnknownModuleException();
280 }
281 const moduleRef = this.modules.get(token)!;
282 return moduleRef.addInjectable(injectable, enhancerSubtype, host);
283 }
284
285 public addExportedProviderOrModule(
286 toExport: Type<any> | DynamicModule,

Callers 1

testHelperFunction · 0.95

Calls 2

hasMethod · 0.80
getMethod · 0.65

Tested by 1

testHelperFunction · 0.76