$rootScope is the global scope which acts as the parent
for all the controllers $scope,
values set in one controller’s $scope can be accessed in other controllers
$scope across the application.
The following example defines 2 controllers, the 1st controller sets value for the variable rootValue and the 2nd controller accesses the value from the rootScope and displays it in the view.
The following example defines 2 controllers, the 1st controller sets value for the variable rootValue and the 2nd controller accesses the value from the rootScope and displays it in the view.