$rootScope.$apply() on connection state change