A

Admin • 825.56K Points
Coach

Q. What does `providedIn: 'root'` mean in Angular services?

  • (A) The service is available application-wide as a singleton
  • (B) The service is only available in the root component
  • (C) The service is destroyed after each request
  • (D) The service is only used in child modules
  • Correct Answer - Option(A)
  • Views: 10
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin
`providedIn: 'root'` registers the service in the root injector and makes it a singleton.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.