I've been playing with Angular2 and tried to find a way to use pub/sub 
mechanism, across the whole component tree.

It seems that EventEmitter is only emitting an event that can be subscribed 
to one level up - but not more. Similarly, it only emits the events up the 
tree, but now downwards. 

plunker here: 
    http://plnkr.co/edit/gputAG?p=info

see
    
    class App {
      onAncestor($event) {
         console.log('in ancestor, decendent  clicked',$event);
      } 
    }

     ...
    class Entities {
       ....
       onParent($event) {
         console.log('in entities parent, child  clicked',$event);
       } 
  
       onGrandParent($event) {
          console.log('in grand parent, grandschild  clicked',$event);
       } 
   }


only onParent is called, never onGrandparent or onAncestor

similarly it wont publish downwards


I wonder how to do it

thanks for any idea
Lior

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to