title: Redirect page after signIn - Angularjs and Kinvey
body: <p>When I try redirect the page to index.html, I get the following error:  $location is undefined.
  I just need to redirect to the index page, when the User and Password are correct.</p>
  
  <pre><code> app.controller('loginController', ['$scope', '$kinvey',  function($scope, $kinvey, $location) {
  
  
       $scope.login = function() {
  
            var promise = $kinvey.User.login({
                  username : $scope.username, 
                  password : $scope.password
              });
  
              promise.then(function(response) {
                console.log('User in');
                $location.path('/index.html');
  
              }, function(err) {
                 console.log(err);
              });  
        }
  
    }
   ]);
  </code></pre>