A

Admin • 825.56K Points
Coach

Q. How can you create a service singleton available application-wide?

  • (A) Use @Injectable({ providedIn: 'root' })
  • (B) Add service in component providers array
  • (C) Add service in local module providers only
  • (D) Create multiple instances manually
  • Correct Answer - Option(A)
  • Views: 11
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin
This ensures a single instance across the entire app.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.