I have an audio element in my service that has a "ended" event listener. I'm trying to communicate that message to an angular controller.
Currently I have this in my service:
Audio.addEventListener "ended", (->
$rootScope.$broadcast("audioEnded")
), false
And in my controller I have:
$scope.$on "audioEnded", ->
console.log("ended scope")
This works but I'm wondering if there is a better way to communicate from a service to a controller without using $rootScope