不同的controller间通信,除了rootScope,
还可以通过angular提供的$on,$emit,$broadcast等方法通信。
在A Controller中
$scope.getName= function(){
doSth……
}
$rootScope.$on('xxx',function(){
$scope.getName();
});
在B Controller中
$scope.$emit('xxx');
会直接调用A controller的
getName();