Bind an InjectableId to an asynchronous factory that will be invoked on demand when the object is needed. The factory should produce the needed value (asynchronously of course). NOTE: The container will not invoke any @PostConstruct present on the class, this is the responsibility of the factory. WARNING!!! The factory may not throw and must return a valid Promise (which can be pending, resolved, rejected, etc.).
Bind an InjectableId to a class (actually it's constructor). As a shortcut, you may use the class constructor as the 'id' (e.g. container.bindClass(A); ). The container will also invoke any @PostConstruct present on the class.
Bind an InjectableId to a constant value. Constants are by their very nature singleton, and are assumed to be error proof.
Bind an InjectableId to a synchronous factory that will be invoked on demand when the object is needed. The factory should produce the needed value NOTE: The container will not invoke any @PostConstruct present on the class, this is the responsibility of the factory.
Return an instance of <T> previously bound to 'id'.
Check to see if the existing InjectableId is known (aka has been bound). Error callbacks may wish to know if a particular InjectableId is available. Also the Binder's bindXXX calls always overwrite any previous bindings, so you may want to use this as a gate.
awaits the asynchronous resolution of all dependencies in the tree for 'id'.
This essentially pre creates/loads all singleton InjectableIds currently known to the Binder. This may be helpful if you wish to use Injector.get on a dependency tree that has asynchronous singletons within the tree.
Only resolve AsyncFactorys as well as any bound classes that have an asynchronous @PostConstruct decorator. WARNING: If true, SyncFactorys will not be resolved even if they are Singletons.
If true and the the container has a parent, resolveIfSingleton will first be called for the parent
A Promise that resolves when all Singleton's have been resolved, OR rejects if one or more of the Singleton's failed to resolve. NOTE: Rejection does not occur until all Singleton resolutions have settled, and the rejection reason/err will be a Map<InjectableId, Error>
Generated using TypeDoc