Angular's signals API, stabilised in Angular 17-18, brings fine-grained reactivity to the framework. Understanding signal(), computed(), effect(), and the new input signal() function is essential for building modern, performant Angular applications.
0 / 5 completed
1 / 5
What is the key difference between signal() and computed() in Angular?
signal() creates a writable reactive primitive — you set it with .set() or .update(). computed() creates a derived, read-only signal whose value is recalculated lazily whenever any of its signal dependencies change.
2 / 5
When does an effect() in Angular re-run?
effect() schedules a side effect that runs whenever any signal accessed inside it emits a new value. Angular's reactive graph tracks which signals were read during the last execution and schedules a re-run when any of them change.
3 / 5
What does toSignal() do in Angular?
toSignal() is part of @angular/core/rxjs-interop and subscribes to an Observable, exposing its latest value as a read-only signal. This lets templates and computed() use Observable data without the async pipe.
4 / 5
In Angular 18, using input signals (input()), how does a component receive an external value compared to @Input()?
The input() function returns a read-only InputSignal. Angular updates its value when the parent's binding changes. Components can react via computed() or effect() instead of implementing ngOnChanges, making change detection more ergonomic.
5 / 5
Which change detection benefit do Angular signals provide over the default ChangeDetectionStrategy.Default?
Angular's signal-based reactivity lets the framework track exactly which template bindings depend on which signals. When a signal changes, Angular can update only the affected bindings without checking the entire component tree, improving performance over dirty-checking.