How to use the @tsed/di.GlobalProviders.get function in @tsed/di

To help you get started, we’ve selected a few @tsed/di examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TypedProject / ts-express-decorators / packages / common / src / server / utils / getConfiguration.ts View on Github external
export function getConfiguration(module: any, configuration: any = {}) {
  const provider = GlobalProviders.get(constructorOf(module))!;

  return {...provider.configuration, ...configuration};
}
github TypedProject / ts-express-decorators / packages / common / src / server / utils / createInjector.ts View on Github external
function createSettingsService(injector: InjectorService) {
  const provider = GlobalProviders.get(ServerSettingsService)!.clone();

  provider.instance = injector.invoke(provider.useClass);
  injector.addProvider(ServerSettingsService, provider);

  return provider.instance;
}