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

Which operator is the modern recommended way to unsubscribe automatically in a component?

  1. A takeUntilDestroyed()
  2. B first()
  3. C take(1)
  4. D finalize()
Answer

takeUntilDestroyed()

Introduced in Angular 16, takeUntilDestroyed ties the subscription to the component's DestroyRef, removing the boilerplate destroy subject pattern.

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