title: how can I make a redirection with Angular.js?
body: <p>I want to make a redirection to another route and the page have to be refreshed and treated server side, so the <code>$location.path(url)</code> can't help me. I have tried <code>window.location(url)</code> but I have this error: <code>window.location is not a function</code></p>
  
  <p>My app.js:</p>
  
  <pre><code>    'use strict';
  var app = angular.module('myApp', []).
    config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
      $routeProvider.when('/', {
          templateUrl: 'partials/index'});
      $routeProvider.when('/logout', {
          controller: 'logoutCtrl'});
      $routeProvider.otherwise({
          redirectTo: '/'});
      $locationProvider.html5Mode(true);
    }]);
  </code></pre>
  
  <p>my logoutCtrl:</p>
  
  <pre><code>function logoutCtrl($scope, $location){
      $apply(function() { 
          $location.path("/users/logout"); 
      });
  }
  </code></pre>
  
  <p>The partials/index contains this link:</p>
  
  <pre><code>a(href='/logout') Logout
  </code></pre>
  
  <p>Now I'm going to show how I manage my routes server side with Express.js:</p>
  
  <pre><code>app.get('/', ctrl.index);
  app.get('/partials/:name', ctrl.partials);
  app.get('/users/logout', ctrl.logout);
  
  exports.logout = function(req, res)
  {
    console.log('logout');
    req.session.destroy(function(err){ // I destroy my session
     res.redirect('/'); // redirection to '/'
    });
  }
  </code></pre>
  
  <p>Now when I click on "logout" nothing happen, I'm just seeing this route <code>localhost:3000/logout</code> in my bar but if I type <code>localhost:3000/users/logout</code> I have the result expected (session destroyed and redirection to '/' )</p>