fabiobiondi / angular-fullscreen

AngularJS HTML5 Fullscreen
214 stars 107 forks source link

Have the Fullscreen service $broadcast fullscreen.changed events on the $rootscope #27

Closed ACReeser closed 10 years ago

ACReeser commented 10 years ago

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.

websirnik commented 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:

cef62 commented 10 years ago

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.