Which AngularJS service is typically used to share data between controllers?

  • $broadcast
  • $http
  • $rootScope
  • $watch
The $rootScope service in AngularJS is typically used to share data between controllers. It is a global scope accessible by all controllers in an application. While using $rootScope can be convenient for sharing data, it's important to use it judiciously to avoid creating tightly coupled components. Understanding how to share data between controllers is crucial for building scalable and maintainable AngularJS applications.
Add your answer
Loading...

Leave a comment

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