Non-peer (no parent-child) Events in Angular 2

3 views
Skip to first unread message

Tim Consolazio

unread,
Jan 12, 2017, 10:53:27 AM1/12/17
to Angular 2
The previous post discussed how parent/children can easily exchange events in terms of dataflow. This post shows how you can create a service that is "floating"; anything that can inject it can broadcast events to anything else that has it injected and has subscribed to it. 

I've heard that this isn't "recommended" and that all events should be shared between a parent and child. For the record, after having built many UIs of all kinds for all kinds of companies out of many different techs and frameworks, I don't buy that at all. 

http://www.tcoz.com/#/errata

Your thoughts?
Reply all
Reply to author
Forward
0 new messages