在AngularJS中是否可以用interval值来设置location.reload()或$state.reload(

Is it possible to set location.reload() or $state.reload() with interval value in AngularJS

本文关键字:reload 设置 location state 是否 AngularJS interval      更新时间:2023-09-26

嗯,我的设计中有十个选项卡面板,在第一个选项卡中,我用来加载数据Ng-bind(),也有支付和未支付的发票标签,有popmodel来支付。

问题是,如果我通过保存按钮对模型弹出做了任何事情,其他选项卡的绑定数据就消失了。我只想刷新那个标签

i使用这个代码location.reload();或state.reload美元();但是没有用,它只是重新加载页面。

是这个的任何解。请与我分享

$scope.collectbill = function() {
            $scope.billDet.amount = $scope.final_amount;
            $scope.billDet.user_id_pk = sessVar.user_id_pk;
            console.log($scope.billDet);
            $http.post('/billPay', $scope.billDet)
                .success(function(data) {
                    if (data.errorMessage != null) {
                        console.log(data.errorMessage);
                        //$scope.frmData = {}; // clear the form so our user is ready to enter another
                    } else {
                        $location.url('/custdetails?' + $scope.invisibleMenu.listcustomer);
                        //window.location = "dashboard#/listcustomer";
                        //location.reload();
                        //$state.reload();
                        Success_Msg("bill Pay", data.msg);
                        //location.reload();
                    }
                })
                .error(function(data, status, headers) {
                    console.log('Error: ' + data);
                });
        }

您必须更具体地说明您的模型和视图。总的来说,这是一个范围问题。您必须检查您的更改应用于哪个$范围,以及这些更改应用于哪个模型。你想用location.reload()实现什么?