A

Admin • 828.70K Points
Coach

Q. How do you declare a service to be provided only in a specific Angular module?

  • (A) Add it to the 'providers' array of that module
  • (B) Use providedIn: 'root'
  • (C) Add it to component's providers array
  • (D) Declare it as private
  • Correct Answer - Option(A)
  • Views: 8
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin
Declaring a service in module providers limits its scope to that module.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.