Suggest an editImprove this articleRefine the answer for “How is inversion of control related to DI?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Inversion of Control (IoC)** is a principle, and **Dependency Injection (DI)** is the way it is implemented in practice. **Key point:** DI is the specific mechanism Angular uses to implement the IoC principle.Shown above the full answer for quick recall.Answer (EN)ImageInversion of Control (**IoC**) is a **principle**, and **Dependency Injection (DI)** is **a way to implement it**. ### In simple terms: - **IoC** says: *"the code should not manage dependencies, someone else should"*; - **DI** does this in practice, *it injects dependencies automatically*. --- ### Example: Without DI (no inversion of control): ```ts const service = new UserService(); const user = service.getUser(); ``` The component **creates** the dependency **itself**, it is "in charge". With DI (inversion of control is present): ```ts constructor(private userService: UserService) {} ``` Now **Angular** creates `UserService` and supplies it to the component. Control over creating objects **has shifted to the framework**, and that is inversion of control. --- **Summary:** DI is the specific mechanism Angular uses to implement the IoC principle.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.