Which decorator is used to inject a service into an Angular component?

  • @Injectable()
  • @Component()
  • @Service()
  • @InjectService()
To inject a service into an Angular component, you use the @Injectable() decorator. This decorator is applied to the service class, allowing Angular's dependency injection system to recognize and provide the service when requested by a component. The other options (@Component(), @Service(), @InjectService()) are not used for this purpose.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *