angularJS广播事件

http://jsfiddle.net/simpulton/geaab/




One directive calls:

$rootScope.$broadcast('someEvent', [1,2,3]);

Second directive listens:

 scope.$on('someEvent', function(event, mass) {
    console.log(mass)}
  );


你可能感兴趣的:(angularJS广播事件)