Documentation

Documentation entry

Documentation is rendered from your GitHub Wiki content, with the same visual language as the rest of the site.

31 results

Aliasing

Create short, readable aliases for long or verbose service identifiers.

Binding Arguments by Name

Bind scalar constructor arguments by parameter name when type-based autowiring is not enough.

CLI Tools

Generate config files, validate wiring, and inspect container definitions from the terminal.

Compiler Pass

Run custom logic at specific phases of the container compilation process.

Compiling the Container

Compile the container to validate dependencies and optimize service resolution.

Conditional Services

Register services only when environment or runtime conditions are satisfied.

Configuration Files

Load and organize container definitions from YAML, JSON, JS, or XML files.

Container Validation

Validate your dependency graph during compile time to catch wiring errors early.

Custom relative service directory

Set a shared base path so service class references stay short and consistent.

Defining Services Dependencies Automatically (Autowiring)

Autowiring uses TypeScript type hints to resolve and inject service dependencies automatically.

Deprecating Services

Mark old services as deprecated and emit warnings when they are used.

Environment Parameters

Inject environment variables into service arguments for dynamic runtime configuration.

How to Decorate Services

Replace a service with a new implementation while preserving access to the original.

How to Define Non Shared Services

Choose between shared singleton services and new instances on each retrieval.

How to Inject Instances into the Container

Register synthetic services when instances are created outside the container.

How to Inject or use Container as Service

Inject the container itself when a service needs runtime access to other services.

How to Manage Common Dependencies with Parent Services

Use parent services to centralize repeated dependencies shared by related classes.

Ignoring Missing Dependencies

Declare optional dependencies without breaking service creation.

Imports

Split large service configuration files and compose them from a root config.

Installation

Install the package and register your first service in a few steps.

Keyed Services

Group multiple implementations under a key and resolve the one you need.

Lazy Service

Delay heavy service instantiation until the first time it is requested.

Load service from package

Register services from npm packages instead of local project files.

Logging dependency injection messages

Use your own logger implementation to control DI warnings and diagnostics.

Marking Services as Public / Private

Control whether services can be fetched directly or only injected as dependencies.

Named exports

Use named exports and multiple classes per file without default exports.

Parameters

Define reusable configuration values and reference them across service files.

Tagging

Label services by capability so they can be discovered and processed in groups.

Using a Factory to Create Services

Create services through factory methods when construction requires custom setup.

Working with definitions

Build and customize service definitions programmatically before compilation.

XML Configuration

Define container imports, parameters, and services using XML files.