Service scope for DI registration
Maps directly to tsyringe's Lifecycle enum. Scope is specified at registration time via provider configuration, not at class decoration time.
// In module providers:{ provide: MY_TOKEN, useClass: MyService, scope: Scope.Singleton }// In Application.ts:container.register(MY_TOKEN, MyService, Scope.Request) Copy
// In module providers:{ provide: MY_TOKEN, useClass: MyService, scope: Scope.Singleton }// In Application.ts:container.register(MY_TOKEN, MyService, Scope.Request)
New instance per child container (per request)
Single instance shared globally
New instance per resolution (default)
Service scope for DI registration
Maps directly to tsyringe's Lifecycle enum. Scope is specified at registration time via provider configuration, not at class decoration time.
Example