'use strict'; (function(){ angular.module('app') .factory('myService', myService); myService.$inject = [ '$rootScope' ]; function myService($rootScope) { var ret = { /* ... some stuff ... */ }; /** * @private * * Called from inside the service when our important value * changes */ function _setData(newValue) { $rootScope.$broadcast('myService:myValueChanged', newValue); } /* other service logic */ return ret; } }());