title: How to remove the hash # from the angularjs ng-route
body: <p>I am trying to use the locationProvider to remove the hashtag from the url routes in angular js but it gives me error.</p>
  
  <p>app.js</p>
  
  <pre><code>var eclassApp = angular.module('eclassApp', 
      ['ngRoute', 'eclassControllers', ]
  );
  
  eclassApp.config(['$routeProvider','$locationProvider',
      function ($routeProvider, $locationProvider){
          $routeProvider.
              when('/',{
                  templateUrl: '/html/student-list.html',
                  controller: 'StudentsListCtrl',
              }).
              when('/students/:studentId',{
                  templateUrl: '/html/student-details.html',
                  controller: 'StudentDetailsCtrl',
  
              }).otherwise({
                  redirectTo: '/students'
              });
              $locationProvider.htmlMode(true);
      }]
  );
  </code></pre>
  
  <p>the error:</p>
  
  <pre><code> Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.13/$injector/modulerr?p0=eclassApp&amp;p1=TypeE…oogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.13%2Fangular.min.js%3A17%3A1)
  </code></pre>
  
  <p>Am I missing something?</p>
  
  <p>EDIT: calling the html5Mode function with options object like this</p>
  
  <pre><code>$locationProvider.html5Mode({
      enabled:true
  })
  </code></pre>
  
  <p>i get the following error (changed to angular full to get a better explanation of the error istead of the minified version)</p>
  
  <pre><code>Error: [$location:nobase] $location in HTML5 mode requires a &lt;base&gt; tag to be present!
  </code></pre>
  
  <p><a href="http://errors.angularjs.org/1.3.13/$location/nobase">http://errors.angularjs.org/1.3.13/$location/nobase</a></p>