Add a rootScope broadcast on the onopen and onclose events.