We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Go Reactive with Angular Signals | Deborah Kurata | ng-conf 2023
Discover the power of Angular Signals, a new feature in v16, offering reactivity without Observables subscribers, designed to improve change detection and decouple components from data and logic.
- Angular Signals are a new feature in Angular v16, part of the developer preview.
- Signals are values with a change notification, providing reactivity without needing Observable subscribers.
- Unlike Observables, Signals only have a single value in their box, and do not emit values.
-
Signals are created with the
signalconstructor function. -
Signals can be read by using parentheses
(), which registers the signal as a dependency. - Changing a Signal replaces the value in the box.
- Computed Signals are calculated based on other Signals, and are read-only.
- Computed Signals are memoized, meaning their values are cached and automatically updated.
- Effects are scheduled to run when their dependent Signals change.
-
Signals can be used with Angular’s
onPushchange detection strategy. -
Signals can be injected into components using the
injectkeyword. - Signals provide a new way to decouple components from the underlying data and logic.
-
There are three ways to modify a Signal:
set,mutate, andcompute. - Signals are designed to improve change detection and reactivity in Angular applications.