Answer
State management refers to how an app organizes and shares data that changes over time, such as the current logged in user, items in a shopping cart, or a form's values. Small apps often manage this using a simple service combined with signals, while larger apps sometimes reach for a dedicated library like NgRx to keep things organized.
@Injectable({ providedIn: 'root' })
export class CartService {
items = signal<Item[]>([]);
addItem(item: Item) {
this.items.update((current) => [...current, item]);
}
}Real-world example A small online store manages its shopping cart entirely with a signal based service, letting any component that injects the service read and react to the current cart contents automatically.