A

Admin • 802.91K Points
Coach

Q. How do you create a service singleton throughout the entire Angular application?

  • (A) Provide it in root injector using providedIn: 'root'
  • (B) Declare it in component providers
  • (C) Use @Singleton decorator
  • (D) Declare it in NgModule's declarations
  • Correct Answer - Option(A)
  • Views: 8
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin
This makes the service singleton and available app-wide.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.