title: $location.path not working from http interceptor
body: <p>this is your fairly straight-forward setup, I have an http interceptor that's looking for 401s, if found the user is redirected to the login page:</p>
  
  <pre><code>function($location, $q)
  {
      return {
          request: function (config) {
              return config || $q.when(config);
          },
          requestError: function(request){
              return $q.reject(request);
          },
          response: function (response) {
              return response || $q.when(response);
          },
          responseError: function (response)
          {
              if (response &amp;&amp; response.status === 401)
              {
                  $location.path('/login');                    
              }
  
              return $q.reject(response);
          }
      };
  
  }
  </code></pre>
  
  <p>The problem is the <code>$location.path('/login')</code> call doesn't seem to work, the path is completely disregarded and I remain on the route (albeit a blank page) I was on when my session expires. One possible workaround is to use the traditional <code>window.location = '/#!/login';</code> but I find this to be less than ideal. I also find that if I remove the <code>return $q.reject(response);</code> line I get it working, BUT this introduces another error where the response's data property cannot be found (solution discussed here: <a href="https://stackoverflow.com/questions/16589752/angular-js-http-post-typeerror-cannot-read-property-data-of-undefined">Angular.js $http.post TypeError: Cannot read property &#39;data&#39; of undefined</a>).</p>
  
  <p>I am running angular 1.2.21.</p>
  
  <p>Any ideas on what might be going on here? Reverting to window.location isn't the end of the world but I'd love a nice tidy solution to this mystery :).</p>
  
  <p>Thanks in advance.</p>