title: AngularJS $routeProvider: routing does not work
body: <p>I created a login page for authentication. Based on the result of authentication, it redirects to different pages.</p>
  
  <p>//controller.js</p>
  
  <pre><code>app.controller("LoginCtrl", ['$scope', '$location', 'loginFactory', function($scope, $location, loginFactory){
      $scope.authenticate = function() {
          loginFactory.login($scope.username, $scope.password)
          .then(function(response) {
              $location.path('/home');
          }, function errorCallBack(response) {
              console.log("Failed auth");
              $location.path('/login');
          });
      }
  }]);
  </code></pre>
  
  <p>The app is defined in the following config.js together with routing.
  //config.js</p>
  
  <pre><code>var app = angular.module('ristoreApp', ['ngRoute']);
  app.config(function ($routeProvider, $locationProvider, $httpProvider) {
      $routeProvider
          .when('/', {
              redirectTo: '/home'
          })
          .when('/login', { 
              templateUrl: 'views/login.html', 
              controller: 'LoginCtrl' 
          })
          .when('/home', { 
              templateUrl: 'views/home.html', 
          })
          .otherwise({ 
              redirectTo: '/login' 
          });
  });
  </code></pre>
  
  <p>The structure of files:</p>
  
  <pre><code>root/
      js/ -- config.js
          -- authentication/ -- controller.js
      views/ -- home.html
             -- login.html
  </code></pre>
  
  <p>When I submit the login form, instead of redirecting to "<a href="http://127.0.0.1:8081/views/login" rel="nofollow">http://127.0.0.1:8081/views/login</a>", it redirects to "<a href="http://127.0.0.1:8081/views/login#/login" rel="nofollow">http://127.0.0.1:8081/views/login#/login</a>". Plus "<a href="http://127.0.0.1:8081/login" rel="nofollow">http://127.0.0.1:8081/login</a>" returns 404.</p>
  
  <p>I start node.js under root. From the "network" tab in Chrome, it shows "config.js" is loaded. Why doesn't the routing work?</p>