ページを更新せずにログインに成功すると、URLを更新したいと考えています。 私は、URLが正常に更新されていない次のコードにURLを角度のjでページを更新しないで新しいURLに置き換える方法
$scope.Login = function (teacher, chkRememberMe) {
alert(chkRememberMe);
$http.post("/Teacher/Login", { teacher: teacher, chkRememberMe: chkRememberMe })
.success(function (result) {
if (result == "True") {
toastr.success("You are Login successfully!!!");
$timeout(function() { }, 5000);
$timeout(function() { }, 5000);
$location.path('Teacher/Index');
}
else {
toastr.error("The email and password you entered don't match.")
window.location = "/Teacher/Login";
}
})
.error(function (error) {
error.message
alert(error);
toastr.error("The email and password you entered don't match11")
})
}
を使用しています。
言葉遣いやスペルミスが修正されました。 – Prune
私はあなたが望むのはngRouteだと信じています。https://docs.angularjs.org/api/ngRoute/service/$route –