injector
@tsed/di
Usage
typescript
import { injector } from "@tsed/di";Overview
ts
function injector(): InjectorService;Description
Get the global injector service instance.
Returns the singleton instance of InjectorService managing all registered providers. Use this to access the DI container programmatically.
Usage
typescript
import {injector, Injectable} from "@tsed/di";
@Injectable()
class MyService {
injector = injector();
getService() {
return injector().get(OtherService);
}
}