# Dependency Injection

*noun*

say it: **“dih-PEN-den-see in-JEK-shun”** **/dɪˈpɛndənsi ɪnˈdʒɛkʃən/**

Angular's system for creating services and handing them to the classes that ask for them.

## What is **Dependency Injection**?

**Dependency injection** is how Angular hands components and services the other services they need. You ask for a `CartService`, and Angular creates one (or reuses the existing one) and gives it to you.

```typescript
export class CartPage {
  private cart = inject(CartService); // Angular supplies it
}
```

## In a sentence

- “Through **dependency injection**, every component asking for Cart gets the same instance.”

Level: Apprentice · [More Angular terms at this level](https://www.ask-codey.com/glossary?category=angular&level=2)

Updated: November 9, 2026

## In other subjects

- [Dependency Injection in ASP.NET Core](https://www.ask-codey.com/glossary/dependency-injection-aspnet-core)
- [Dependency Injection in OOP](https://www.ask-codey.com/glossary/dependency-injection)

Source: https://www.ask-codey.com/glossary/dependency-injection-angular
