Services and Injectable
Create injectable services for shared logic.
Services and Injectable
A service is a class that holds reusable logic or state, such as data fetching or a shared store. Angular creates and shares services through dependency injection.
Why Services
Components should focus on the view. Move business logic, API calls, and shared state into services so they can be reused and tested independently.
All lessons in this course
- Services and Injectable
- The inject Function
- Providers and Scopes
- Injection Tokens