Closed ACReeser closed 10 years ago
Oh, so cool you've pushed it today. I've stumbled upon a need for this event just now :) Have tested your code, seems to work for me :+1:
Generally it's better avoid to use $broadcast
, We've added the dispatching feature to the factory but using $emit
. You'll have to inject the factory to listen to the event, you can see an example in the fullscreen
directive.
I found it easiest to move this logic out of directives and controllers and into the one service. The namespace + name of the event is unimportant. This Plunker, shows it in action, and you can test it by launching Plunker's separate window.