Angular · Middle · Question 18 of 75
How does BehaviorSubject differ from Subject?
- ✓Correct answer: It requires an initial value, stores the current one and emits it to each new subscriber immediately
- 2It can only emit once and then completes
- 3It sends values only to the first subscriber
Explanation
A plain Subject emits only future values, so late subscribers miss earlier ones. BehaviorSubject (and getValue()) was the classic way to hold service state; in modern Angular a signal often replaces it.