$rootScope.$emit只允许其他$rootScope听众抓住它。当你不想让每个人$scope都得到它时,这是很好的。主要是高层沟通。想想它是成人在一个房间里相互交谈的,所以孩子们听不到。
$rootScope.$broadcast是一种几乎可以让所有人听到的方法。这相当于父母大声嚷嚷,晚餐已经准备就绪,所以每个人都在听到。
$scope.$emit是当你想要$scope和所有的父母和$rootScope听到的事件。这是一个孩子在家里向家长发怨言(但不在其他孩子可以听到的杂货店)。
$scope.$broadcast是为了$scope自己和孩子。这是一个孩子耳语的毛绒动物,所以他们的父母听不到。
原文
$rootScope.$emit only lets other $rootScope listeners catch it. This is good when you don't want every $scope to get it. Mostly a high level communication. Think of it as adults talking to each other in a room so the kids can't hear them.
$rootScope.$broadcast is a method that lets pretty much everything hear it. This would be the equivalent of parents yelling that dinner is ready so everyone in the house hears it.
$scope.$emit is when you want that $scope and all its parents and $rootScope to hear the event. This is a child whining to their parents at home (but not at a grocery store where other kids can hear).
$scope.$broadcast is for the $scope itself and its children. This is a child whispering to its stuffed animals so their parents can't hear.
链接 : https://stackoverflow.com/questions/26752030/rootscope-broadcast-vs-scope-emit