Skip to main content

Component, Service, Signals and RxJS State

Learn Component, Service, Signals and RxJS State (Phase 11 · State Management (Core), Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Where state lives • Component state : UI-only, short-lived data (is the menu open, current tab, form values). Keep it in the component with a signal . • Service state : data shared by several components (cart, current user, filters). A root (or feature-scoped) service holds it and exposes read-only signals/observables plus methods to change it. • Server state : data that belongs to the API (lists, records) with caching/invalidation concerns: a store, httpResource , or a query library. • URL state : filters, page, selected id belong in the route (shareable, refresh-safe).

More lessons in Phase 11 · State Management (Core)