Skip to content
masterclass Buddy

Angular · Concept

Dependency injection

Angular dependency injection supplies a class with values, functions, objects, or services from outside the class. Code provides dependencies, and components, directives, services, and factory functions can inject them when running in an injection context.

Last updated

Syntax

inject(Token)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Dependency Injection
  • services
  • inject
  • injection context
  • providers
  • InjectionToken
  • components
  • directives

Source: Dependency Injection • Overview • Angular. Checked 2026-11-03.