A

Admin • 828.70K Points
Coach

Q. How can you inject a service into a component?

  • (A) By adding it to the component constructor parameters
  • (B) By importing the service file
  • (C) By using @Injectable decorator in the component
  • (D) By using @Component decorator
  • Correct Answer - Option(A)
  • Views: 12
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin
Services are injected via constructor parameters and Angular DI system.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.