Injects the instance associated with the given class.
Throws an error if the class is not registered in the container.
Optional
name: stringInjects all instances provided by the registrations associated with the given class.
Throws an error if the class is not registered in the container.
Injects the instance associated with the given class,
or undefined
if the class is not registered in the container.
Optional
name: stringInjects all instances provided by the registrations associated with the given class, or an empty array if the class is not registered in the container.
Runs a function inside the injection context of this injector.
Note that injection functions (inject
, injectAll
, optional
, optionalAll
)
are only usable synchronously: they cannot be called from asynchronous callbacks
or after any await
points.
The function to be run in the context of this injector.
The return value of the function, if any.
Injector API.