Skip to content

createContainer · Core API

function createContainer(providers?): Container;

Creates a root container with optional initial providers.

Root containers own singleton instances for providers registered in them.

Parameter Type Default value Description

providers

readonly Provider[]

[]

Providers registered before the first resolution.

Container

A new root container.

DuplicateProviderError When the initial providers contain the same token more than once.