# Service

*noun*

say it: **“SER-vis”** **/ˈsɜːrvɪs/**

A shared Angular class for logic or data that many components use.

## What is **Service**?

A **service** is a class that holds logic or data shared by many components, such as calling an API or keeping the shopping cart. Components ask for services instead of creating them.

```typescript
@Injectable({ providedIn: 'root' })
export class CartService {
  items: Product[] = [];
  add(product: Product) { this.items.push(product); }
}
```

## In a sentence

- “The Cart **service** holds the cart, and every component reads it.”

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

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/service
