Marks a class as injectable (eligible for DI container registration). When the DecoratorPlugin runs, injectable classes in its services list (or discovered) are registered with the DI container when present, or instantiated directly otherwise.
DecoratorPlugin
services
Optional
Optional scope and token
A class decorator
@Injectable({ scope: 'singleton', token: 'user-service' })class UserService { … } Copy
@Injectable({ scope: 'singleton', token: 'user-service' })class UserService { … }
0.1.0
Marks a class as injectable (eligible for DI container registration). When the
DecoratorPluginruns, injectable classes in itsserviceslist (or discovered) are registered with the DI container when present, or instantiated directly otherwise.