Services and Dependency Injection
Control whether a dependency is global or isolated to part of the component tree.
- Dependency Injection Hierarchy
Understand environment, root, route, component, and element injectors.
- Facade Service Pattern
Hide complex state and API coordination behind a simple service interface.
- inject Function and Injection Context
Use inject() correctly and understand where an injection context exists.
- InjectionToken
Inject configuration and non-class dependencies with strongly typed tokens.
- Optional, Self, SkipSelf, and Host
Control how Angular resolves dependencies through the injector hierarchy.
- Provider Configuration
Use class, value, factory, existing, and multi providers correctly.
- Services and Dependency Injection
Understand how Angular services contain reusable logic and how Dependency Injection provides those services to components and other application features.
- Singleton Service Patterns
Choose the correct provider scope for application-wide and feature-specific services.