title: broadcast listener called twice in angular
body: <p>I have a login controller where I am trying to signup/login:</p>
  
  <pre><code>app.controller('signupController', function($scope, $sessionStorage, $state, authService){
  
      $scope.$storage = $sessionStorage;
  
      $scope.socialAuthentication = function(e){
          authService.login(e);
      };
  
      $scope.logout = function(e){
          authService.logout();
      };
  
      $scope.$on('authenticate', function(event, data){
          console.log('user ', data); // prints twice here
          if(data != null &amp;&amp; data.access_token != ""){
              $scope.$storage.isLoggedIn = true;
          } else {
              $scope.$storage.isLoggedIn = false;
          }
          $state.go('home');
      });
  });
  </code></pre>
  
  <p>Auth Service:</p>
  
  <pre><code>app.service('authService', function($rootScope, $http){
  
      this.login = function(e){
          var social = e.currentTarget.dataset.social;
          popupTools.popup('/auth/'+social+'/', "Authentication", {}, function (err, user) {
              if (err) {
                  console.log(err.message);
                  return false;
              } else {
                  $rootScope.$broadcast('authenticate', user);
              }
          });
      };
  
      this.logout = function(){
          $rootScope.$broadcast('authenticate', null);
      };
  });
  </code></pre>
  
  <p>The problem is <code>$scope.$on</code> is called twice printing the log messages twice. Why is that so, I am not able to understand.</p>