如何通过mvc动作在角度函数后重定向

时间:2015-04-18 15:28:01

标签: asp.net-mvc angularjs

我想通过mvc动作在角度函数成功后重定向用户。这是我的控制器:

   $scope.login = function () {
        debugger;
        authService.login($scope.loginData).then(function (response) {
            debugger;

            $modalInstance.close(true);
            $location.path('/Home');
        },
         function (err) {
             $scope.message = err.error_description;
             $modalInstance.dismiss();
         });
    };  

但它不起作用?

肮脏的方式是:

<p class="login-success" ng-if="cartable">


                    @Html.ActionLink("ورود به کارتابل", "Index", "Home", null, null)


                    </p>

1 个答案:

答案 0 :(得分:2)

如果你尝试使用vanilla javascript方式怎么办?

window.location.href="yournewUrlHere";
相关问题