0Pricing
TypeScript Academy · Lesson

DI Containers with InversifyJS

Register and resolve services with a container.

Why a DI Container?

Manually wiring large object graphs is tedious and error-prone. A DI container registers how to build each dependency and resolves them automatically. InversifyJS is a popular TypeScript container.

Installing and Enabling

InversifyJS relies on decorators and reflection metadata. You import from inversify and enable experimentalDecorators plus reflect-metadata.

import "reflect-metadata";
import { Container, injectable, inject } from "inversify";

All lessons in this course

  1. Inversion of Control Basics
  2. Constructor Injection
  3. DI Containers with InversifyJS
  4. Type-Safe Service Tokens
← Back to TypeScript Academy