How can I emit events from a factory or service. I am unable to inject $scope into the factory, thus unable to emit events.
I get the following error - Unknow
Unknow
In your factory inject $rootScope as-
myApp.factory('myFactory',function($rootScope){ return({ // use $rootScope as below to pass myEventParams to all below in hierarchy $rootScope.$broadcast("myEvent",myEventParams); }) }]);