A

Admin • 830.13K Points
Coach

Q. How do you make a service available application-wide?

  • (A) Provide it in root using `providedIn: 'root'`
  • (B) Provide it in every component
  • (C) Use global flag in angular.json
  • (D) Add it to index.html
  • Correct Answer - Option(A)
  • Views: 19
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin
`providedIn: 'root'` makes a service singleton and available throughout the app.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.