Which providedIn value ensures that a service instance is shared across the entire application?

  • 'app'
  • 'global'
  • 'root'
  • 'shared'
The 'root' providedIn value ensures that a service instance is shared across the entire Angular application. When a service is provided with 'root', it becomes a singleton service, and there is only one instance of it created and shared throughout the entire application. This is commonly used for services that should have a single, shared state across components.
Add your answer
Loading...

Leave a comment

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