Function: Service()
Function: Service()
function Service<T>(options): ClassDecorator;
Service decorator to mark a class as a service and automatically bind it to the container.
This decorator is useful for marking classes that should be treated as services by the Stone.js framework, making them easily injectable and manageable by the service container.
Type Parameters
T
T
extends ClassType
= ClassType
Parameters
options
Partial
<ServiceOptions
> = {}
The configuration options for the service, including singleton and alias settings.
Returns
ClassDecorator
A decorator function to set metadata on the target class.
Example
@Service({ singleton: true, alias: 'MyService' })
class MyService {
// Service class logic here.
}