title: Angular js - call a route without view
body: <p>I'm trying calling the <code>/auth/logout</code> url to get redirected after session is deleted:</p>
  
  <pre><code>app.config(['$routeProvider',function($routeProvider) {
      $routeProvider
      .when('/auth/logout',{
          controller:'AuthLogout'
          //templateUrl: not needed
  
      })
  })
  .controller('AuthLogout', ['$window','$location', function ($window,$location) {
      $window.localStorage.removeItem('user_username');
      $window.localStorage.removeItem('user_id');
      $window.localStorage.removeItem('user_session_token');
      $location.path('/');
  }]);
  </code></pre>
  
  <p>I actually don't need a view for AuthLogout controller but if I do not specify the <code>templateUrl</code> in routeProvider I can't get this to work, while if I specify a <code>templateUrl</code> it works.</p>
  
  <p>How can I call the url/controller without to having to load a view??</p>