createChildContainer · Core API
function createChildContainer(parent, providers?): Container;Creates a child container that can resolve providers from its parent.
Child containers may register their own providers while still reusing parent providers. Scoped providers create one cached instance per resolving child.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
|
|
|
Container used as the fallback provider registry. |
|
|
|
readonly |
|
Providers registered locally in the child. |
Returns
Section titled “Returns”A new child container.
Throws
Section titled “Throws”DuplicateProviderError When the child providers contain the same
token more than once.