当我尝试将页面重定向到 index.html 时,我收到以下错误:$location 未定义。当用户和密码正确时,我只需要重定向到索引页面。
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);
});
}
}
]);