title: $state is not recognized inside the callback of $stateChangeStart
body: <p>I am having a problem that $state is not recognized inside my "on" event function.</p>
  
  <p>This is my code:</p>
  
  <pre><code>.run(['$rootScope', '$state', function ($rootScope, $state) {
  
      $rootScope.$on('$stateChangeStart', function (evt, toState) {
          if (!sessionStorage.token)
            $state.go('main');                
      });
  }]);
  </code></pre>
  
  <p>I even tried to add </p>
  
  <pre><code>$rootScope.$state = $state;
  </code></pre>
  
  <p>but this still doesn't work. 
  I don't get why $state is undefined when i debug it.</p>
  
  <p>I saw it is working fine in many examples other the web.</p>