Angular · Middle · Question 18 of 75

How does BehaviorSubject differ from Subject?

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.

Further reading

Problem with a question

Angular · Middle · question 18

Test yourself

Take the Angular · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz