What is the difference between $scope.$root and $rootScope?
问题 I see in controllers that $scope has $root, what is this? How is it different from $rootScope which can be injected in the controller? 回答1: $rootScope var which points to the parent of all the scopes and can be injected everywhere. All other scopes are children of the $rootScope . They are created via the $new method of the $rootScope thus every scope inherits from the $rootScope . In the angular source in the definition of the Scope constructor there is a line : function Scope() { this.$id =