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.
SubscribeRelated
Dependency Injectionservicesinjectinjection contextprovidersInjectionTokencomponentsdirectives