Experimental
A descriptor of a service declared as a dependency of another service.
Currently, this is only used to describe the dependencies of a service to its corresponding factory function.
@Service([[AnotherService, Optional()]], { factory (id, container, dependencies: DependencyDescriptor[]) { const [anotherService] = dependencies; assert(anotherService.id === AnotherService); assert(anotherService.constraints & Optional()); }}); Copy
@Service([[AnotherService, Optional()]], { factory (id, container, dependencies: DependencyDescriptor[]) { const [anotherService] = dependencies; assert(anotherService.id === AnotherService); assert(anotherService.constraints & Optional()); }});
Optional
The constraints of the given service, if any.
ResolutionConstraintFlag
The identifier of the declared dependency.
Generated using TypeDoc
A descriptor of a service declared as a dependency of another service.
Remarks
Currently, this is only used to describe the dependencies of a service to its corresponding factory function.
Example