title: Firebase authenticating with routers
body: <p>I'm trying to get the basic Firebase authenticating to work with routers(ui-router) as in <a href="https://github.com/firebase/angularfire/blob/master/docs/guide/user-auth.md#authenticating-with-routers" rel="nofollow noreferrer">this</a> example. For some reason I can't get this to work. It rejects me from going to any of the states and when I try to log the error in the run function it responses with <a href="http://errors.angularjs.org/1.4.4/$injector/unpr?p0=%24firebaseAuthProvider%20%3C-%20%24firebaseAuth%20%3C-%20Auth" rel="nofollow noreferrer">this</a> error.</p>
  
  <p>Here is my code: </p>
  
  <pre><code>var app = angular.module('app', ['ui.router']);
  
  app.run(["$rootScope", "$location", function($rootScope, $location) {
  
      $rootScope.$on("$stateChangeError", function(event, toState, toParams, fromState, fromParams, error) {
          // We can catch the error thrown when the $requireSignIn promise is rejected
          // and redirect the user back to the home page
          if(error === "AUTH_REQUIRED") {
              $state.go("home");
          }
       });
  }]);
  
  app.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
  
      $stateProvider
      .state('home', {
          url: '/',
          templateUrl: 'partials/home.html',
          controller: 'mainController',
          resolve: {
              // controller will not be loaded until $waitForSignIn resolves
              // Auth refers to our $firebaseAuth wrapper in the factory below
              "currentAuth": ["Auth", function(Auth) {
                  // $waitForSignIn returns a promise so the resolve waits for it to complete
                  return Auth.$waitForSignIn();
              }]
          }
      })
      .state('create', {
          url: '/create',
          templateUrl: 'partials/create.html',
          controller: 'createController',
          resolve: {
              // controller will not be loaded until $waitForSignIn resolves
              // Auth refers to our $firebaseAuth wrapper in the factory below
              "currentAuth": ["Auth", function(Auth) {
                  // $waitForSignIn returns a promise so the resolve waits for it to complete
                  return Auth.$waitForSignIn();
              }]
          }
      })
      .state('share', {
          url: '/share',
          templateUrl: 'partials/share.html',
          controller: 'shareController',
          resolve: {
              // controller will not be loaded until $requireSignIn resolves
              // Auth refers to our $firebaseAuth wrapper in the factory below
              "currentAuth": ["Auth", function(Auth) {
                  // $requireSignIn returns a promise so the resolve waits for it to complete
                  // If the promise is rejected, it will throw a $stateChangeError (see above)
                  return Auth.$requireSignIn();
              }]
          }
      });
  
      $urlRouterProvider.otherwise('/');
  });
  
  app.factory("Auth", ["$firebaseAuth",
      function($firebaseAuth) {
          return $firebaseAuth();
      }
  ]);
  </code></pre>