title: How to $rootScope.$broadcast from services in angular.js
body: <p>How can I $rootScope.$broadcast from services in angular.js </p>
  
  <p>after $rootScope.$broadcast I would like to console.log(data) from controller but I do not see anything in the console</p>
  
  <p>my code:</p>
  
  <pre><code>'use strict';
  
  angular.module('adf.widget.charts')
     .factory('chartService', function ($q, $rootScope){
      return {
        getSpreadsheet: function init(path){
          var deferred = $q.defer();
          Tabletop.init({
            key: path,
            callback: function(data, Tabletop) {
               $rootScope.$broadcast(data)
        },
            simpleSheet: true,
            debug: true
          });
        }
      }
  
    })
  
  
    .controller('piechartCtrl', ['$scope', 'chartService', function($scope, chartService, urls) {
      $scope.$on('getSpreadsheet', function(data){
        console.log(data)
      });
  
    }]);
  </code></pre>