我试图重新指导我的用户,如果他们通过我的表单验证(检查用户名和密码对数据库值)。
验证工作正常,但在我的.Success函数重定向似乎没有工作,它会产生错误:'ReferenceError:$窗口未定义'。
下面的代码:
.success(function(data) {
console.log(data);
if (!data.success) {
// if not successful, bind errors to error variables
$scope.errorUserName = data.errors.userName;
$scope.errorUserPassword = data.errors.userPassword;
} else {
// if successful, bind success message to message
$scope.message = data.message;
$window.location=('twitter.com');
}
});
我试图改变位置路径,但似乎没有奏效。有任何想法吗?
谢谢!
LazyTotoro
Twitter.com只是一个占位符! :) – Charkizard