I understand that $ rootScope is some kind of global variable that allows it to be shared between controllers. Factories can also do the same. So why not use a factory instead? When should $ rootScope be used and when should factory be used, given that they accomplish almost the same purpose?
AngularJS FAQs are pretty good here :
$rootScope ,Angular, . , , , ., . $rootScope , . , , , , ng-show, , $scope., , $rootScope , () . , , . $rootScope, , , , ., , .
$rootScope ,
Angular, . , , , .
, . $rootScope , . , , , , ng-show, , $scope.
, , $rootScope , () . , , . $rootScope, , , , .
, , .
$rootScope . ( : , , - ), $rootScope.99% . .
- (factory). $rootScope , , , . $rootScope , ($rootScope.$broadcast), / , .
$rootScope
$rootScope.$broadcast
Source: https://habr.com/ru/post/1621697/More articles:POST login does not work in production - ruby | fooobar.comКак запустить symfony через докер-композитор - dockerHow to show font amazing icons (e.g. views) on a css hover overlay? - javascriptI am trying to solve a system of nonlinear equations in node.js - javascriptError: Error: cannot find module 'in angular js? - angularjsC ++ 11 static rvalue reference - c ++ 11https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1621699/how-to-apply-css-to-other-elements-except-the-hovered-one&usg=ALkJrhgxWXIQqc3Arfrjc9ibFYMQU_nvtQSibling Opacity - jqueryLike x = new int [2]; work in this java code? - javaTesting try / catch with a function in Java 8 - javaAll Articles