Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What is the difference between BehaviorSubject and Subject?

  1. A BehaviorSubject holds a current value and emits it immediately to new subscribers
  2. B Subject holds a current value
  3. C BehaviorSubject cannot emit new values
  4. D They are identical
Answer

BehaviorSubject holds a current value and emits it immediately to new subscribers

BehaviorSubject requires an initial value and is the usual choice for shared state in a service, since late subscribers receive the current value.

All Angular MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as