# Angular Services

Angular Services: Services and inject(), Why Share Data Between Components?, Creating a Shared Data Service.

Updated: November 15, 2026

1. [Services and inject()](https://www.ask-codey.com/lessons/angular-services-services-and-inject) (Apprentice): A service is a class for work that isn't about showing anything, such as calculations or calling an API. Mark it @Service(), and any component gets the one shared instance with inject(), like dependency injection in ASP.NET Core.
2. [Why Share Data Between Components?](https://www.ask-codey.com/lessons/angular-services-why-share-data-between-components) (Journeyman): Inputs and outputs only connect parents and children. When components far apart need the same data, such as a cart shown in the header and filled from a product page, passing it through every component in between gets messy. A shared service holds it in one place instead.
3. [Creating a Shared Data Service](https://www.ask-codey.com/lessons/angular-services-creating-a-shared-data-service) (Journeyman): A shared data service keeps its state in a private signal, shows it to components read-only with asReadonly() and computed values, and changes it only through its own methods. Every component that injects it sees the same, up-to-date data.

Source: https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/topics/angular-services
