title: Angular - Logout redirect route
body: <p>I am trying to create a route that clears the users session and redirects them back to the root homepage.</p>
  
  <pre><code>.config(function config( $routeProvider, $stateProvider ) {
  
      $routeProvider.
          when('/logout', {resolve: {redirect: function(Session){
              Session.clear();
              return "/home";
          }}});
  </code></pre>
  
  <p>I'm obviously doing something wrong here, as calling</p>
  
  <pre><code>$location.path("/logout");
  </code></pre>
  
  <p>... ignores the function and redirects back to the default route. I've tried adding console.log statements to the function to see if it is being called.</p>
  
  <p>Am I using the redirect function incorrectly?</p>