I am facing an issue with some audio elements in my service that listen for the "ended" event. I am looking for a way to pass this message to an angular controller.
Currently, my service code looks like this:
Audio.addEventListener "ended", (->
$rootScope.$broadcast("audioEnded")
), false
And in my controller, I have the following:
$scope.$on "audioEnded", ->
console.log("ended scope")
While this solution works, I am exploring alternative methods of communication between services and controllers without relying on $rootScope.