Angular is becoming more reactive with signals
Signal is just a special type of variable that holds a value. But unlike other variables, a signal also provides notification when the variable value changes.
- A signal is a variable + change notification
- A signal is reactive, and is called a "reactive primitive"
- A signal always has a value
A signal is synchronous and is not a replacement for #RxJS and Observables for asynchronous operations, such as http.get
Where can we use signals?
- Use them in components to track local component state
- Use them in directives
- Use them in a service to share state across components
- Read them in a template to display signal values
Or use them anywhere else in your code.