【问题标题】:How to redirect after angular function by mvc action如何通过 mvc 动作在角度函数后重定向
【发布时间】:2015-04-18 15:28:01
【问题描述】:

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

   $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>

【问题讨论】:

    标签: asp.net-mvc angularjs


    【解决方案1】:

    如果您尝试使用 vanilla javascript 方式会怎样?

    window.location.href="yournewUrlHere";
    

    【讨论】:

      猜你喜欢
      • 2015-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-29
      • 2020-02-23
      • 2017-05-26
      • 1970-01-01
      • 2019-02-16
      相关资源
      最近更新 更多