Add scoped factory and create matching ref. If ref is given it is reused
A scoped factory is only used once per scope.
Optional
ref: RefSymbol<T>reference
given or newly created reference
Add singleton factory and create matching ref. If ref is given it is reused
A singleton factory is only used once and the result cached until it is cleared.
Optional
ref: RefSymbol<T>reference
given or newly created reference
Add transient factory and create matching ref. If ref is given it is reused
A transient factory is used for every access and the result is never cached.
Optional
ref: RefSymbol<T>reference
given or newly created reference
Remove all or specific ref from container but leaves factory intact. Only relevant for singleton or scoped services
Optional
ref: RefSymbol<T>reference
true if something was removed
Create a fully independent clone of the current container
container
Retrieves the data from the container referenced by the given RefSymbol. If there is no data available it returns undefined but never throws an exception.
reference
The referenced data from the container or undefined.
Retrieves the data from the container referenced by the given RefSymbol. If there is no data available it throws an exception defined by the container.
reference
The referenced data from the container.
Merge two or more containers. Conflicting factories, service lifetimes and singletons are overwritten by priority, see args.
Rest
...args: T[]container, ordered descending by priority
Removes all or specific ref from container which includes the factory.
Optional
ref: RefSymbol<T>reference
true if something was removed
Creates separate scope from the current container. Data except scope is shared between copy and original object.
container
Renews scope of current container.
Generated using TypeDoc
Container interface for full functionality.