Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Managing Server State: resource, httpResource, chain() and Invalidation After Mutations
In Angular 22, server state is managed with the resource family, which carries the loading, error, reloading and local statuses itself: read with httpResource, write with HttpClient, and refresh the resource with reload() after a mutation. On Bookstore's book page we show with real output dependent resources with chain(), an optimistic review with rollback, two components fetching the same list, NgRx 22's withPreviousValueOnLoading and what reading value() in error does.
What Is State in Angular and Where Should It Live? Separating Server, UI, URL and Form State
Where state lives is decided by two questions: who owns the data (the API, the address bar, the browser) and how long it must live; server state goes in a resource, URL state in a query param, local state in the component, shared client state in a service, and derived values are never stored. On Bookstore's catalog page we show with a real run what happens to the four kinds on Back and on reload, and prove that copying the API response into a global store shows stale stock.
Angular 20: Stable Signal APIs, httpResource and the New File Naming
In Angular 20, effect, toSignal and linkedSignal become stable, resource swaps request for params, httpResource arrives, app.ts replaces app.component.ts and *ngIf gets deprecated.