What is the purpose of using the providedIn property when creating a service in Angular?

  • It specifies the service's dependencies
  • It specifies the service's instance scope
  • It specifies the service's name
  • It specifies the service's provider
The providedIn property in Angular service metadata is used to specify the service's instance scope. By specifying a module, the service will be a singleton, providing a single shared instance.
Add your answer
Loading...

Leave a comment

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