Full answer
Signals and Observables solve different problems, and a modern Angular app uses both.
A signal is a container for a current value. You read it synchronously (count()), Angular knows who read it, and the screen updates when it changes. It always has a value. There is no subscription to clean up, and computed gives cached derived values.
An Observable is a description of values arriving over time. It can emit many values, complete, or fail. It is lazy, cancellable, and has a large operator library (debounceTime, switchMap, retry, combineLatest).
Choose by the question you are asking:
- "What is the current value?" Signal. Examples: the selected tab, a cart total, a loaded user.
- "What happens over time?" Observable. Examples: a search box with debounce, an HTTP call with retry, a websocket feed, router events.
- "Do I need cancellation, timing, or combining of streams?" Observable.
- "Do I need to show a value in a template?" Convert to a signal with
toSignal, or use theasyncpipe.
Typical pattern: keep UI state in signals, use RxJS for the asynchronous pipeline, and end the pipeline with toSignal. For simple data loading, resource and httpResource (experimental) wrap this pattern.
What not to do: do not wrap every signal in an Observable and back, and do not use a BehaviorSubject for plain state in new code. Do not call subscribe inside a component when toSignal or the async pipe can do it.
HttpClient still returns Observables, and the Angular router, forms (valueChanges), and many libraries use them, so RxJS knowledge stays necessary.
import { Component, signal } from '@angular/core';
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
import { debounceTime, distinctUntilChanged, map } from 'rxjs';
@Component({
selector: 'app-name-filter',
template: `
<input #box placeholder="Filter names" (input)="query.set(box.value)" />
<p>Typing: {{ query() }}</p>
<ul>
@for (n of matches(); track n) {
<li>{{ n }}</li>
}
</ul>
`,
})
export class NameFilterComponent {
private readonly names = ['Asha', 'Imran', 'Meera', 'Ishaan'];
// State: the current text.
readonly query = signal('');
// Time: wait until the user pauses, then filter. The result is a signal again.
readonly matches = toSignal(
toObservable(this.query).pipe(
debounceTime(250),
distinctUntilChanged(),
map((q) => this.names.filter((n) => n.toLowerCase().includes(q.toLowerCase()))),
),
{ initialValue: this.names },
);
}Angular 20.3, strict template check passes. The component keeps the query in a signal, debounces through RxJS, and shows the result as a signal.
Key points
- Signal: current value, synchronous, no cleanup. Observable: stream over time, lazy, cancellable.
- Use RxJS for debounce, retry, cancellation, and combining streams.
- End the stream with `toSignal` or the `async` pipe for the template.
- Do not convert back and forth without a reason.
Common mistakes
- Using a `BehaviorSubject` plus subscriptions for simple component state.
- Subscribing in components and storing results in fields by hand.
- Assuming signals replace RxJS completely. They do not handle timing or cancellation.
Follow-ups
- How would you debounce a signal?
- What does `toSignal` do with errors?
- Which one would you use for a form's value changes?
Tips
- Use the two questions: "current value" or "over time". They are easy to remember.
- Show a realistic pairing: debounced search ending in `toSignal`.
- Be balanced. Interviewers dislike "RxJS is dead" answers.
Evaluation rubric
- Gives a clear selection rule.
- Describes the typical combined pattern.
- Avoids absolute statements.