A

Admin • 833.24K Points
Coach

Q. How do you make an Angular service available to the entire application?

  • (A) Add 'providedIn: root' in the @Injectable decorator
  • (B) Add service in component's providers array
  • (C) Add service in a module's declarations
  • (D) Add service in app.component.html
  • Correct Answer - Option(A)
  • Views: 38
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin

This provides a singleton service application-wide via the root injector.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.