A

Admin • 828.70K Points
Coach

Q. What will happen if you add a service in the providers array of a component?

  • (A) The service will be singleton app-wide
  • (B) A new instance will be created for that component and its children
  • (C) The service will be globally available
  • (D) It will throw an error
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin
Component-level providers create a new instance scoped to that component subtree.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.