title: angular module.run ReferenceError: $location is not defined
body: <p>I want to AngularJS Change Path Without Reloading, look <a href="http://joelsaupe.com/programming/angularjs-change-path-without-reloading/">http://joelsaupe.com/programming/angularjs-change-path-without-reloading/</a></p>
  
  <p>in core.js:</p>
  
  <pre><code> 'use strict';
      angular.module('App',['ngRoute'])
          .run(['$route', '$rootScope', '$location', function ($route, $rootScope, $location) {
          var original = $location.path;
          $location.path = function (path, reload) {
              if (reload === false) {
                  var lastRoute = $route.current;
                  var un = $rootScope.$on('$locationChangeSuccess', function () {
                      $route.current = lastRoute;
                      un();
                  });
              }
              return original.apply($location, [path]);
          };
      }]);
  </code></pre>
  
  <p>In controller:</p>
  
  <pre><code>    angular.module('App')        
          .controller('DetailController', ['$scope', '$location',  function($scope) {
    $scope.changeURL = function(){
              console.log("IN changeURL");
              $location.path('/sample/gfshdfdsf', false);
          };      
      }]);
  </code></pre>
  
  <p>If invoke changeURL, it will occur error:<code>ReferenceError: $location is not defined</code></p>
  
  <p>Can somebody help me? Thanks!</p>