Connect with:
About Me
Alessandro Annini
I'm a freelance developer currently working at Leaff.it/ I really love famo.us framework and its amazing potential and if you're like me, and you want the web to win, please share some snippet of code for the community and grow faster with us
Categories
Meta
Famo.us Code | Widget with Surface Events Piped
517
post-template-default,single,single-post,postid-517,single-format-standard,ajax_updown_fade,page_not_loaded,,qode-theme-ver-6.2.1

Widget with Surface Events Piped

10 Jul Widget with Surface Events Piped

There are times when you want to create a View that has a Surface attached.  The issue is there is a need for the Surface to broadcast it’s own events to the view.

Here is the trick to making sure you pipe from to the view:
surface.pipe(view._eventOutput);
The following shows how to create the Widget in a manner that allows you to capture those events from the surface.

Note: Be careful when piping more than one surface in the view. You will not know which surface created the event. Some argument has been made to have events carry target data or use an event proxy.

Regards,
Tony