title: AngularJS: Uncaught ReferenceError: $rootScope is not defined in run
body: <p>I am trying to route all unauthorized traffic to the login page, and am using angularfire to authenticate. <a href="http://plnkr.co/edit/r2C9dq0A9E2UPENiuudl?p=preview" rel="nofollow">Here's all the relevant code.</a> I know most of it is broken, but I'd like to get past this first. The problematic code is:</p>
  
  <p>App.js</p>
  
  <pre><code> app.run(['$rootScope', '$location', 'AuthenticatorService', function ($rootScope, $location, AuthenticatorService) {
          $rootScope.$on('$routeChangeStart', function (event) {
  
              if (AuthenticatorService.isLoggedIn) {
                  console.log('DENY');
                  event.preventDefault();
                  $location.path('/login');
              }
              else {
                  console.log('ALLOW');
                  $location.path('/home');
              }
          });
      }]);
  </code></pre>