簡體   English   中英

是否可以在AngularJS中使用時間間隔值設置location.reload()或$ state.reload()

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

好吧,我的設計中有十個選項卡窗格,在第一個選項卡中,我曾經使用ng-bind()加載數據,也有帶有popmodel進行付款的已付款和未付款發票選項卡。

問題是,如果我通過“保存”按鈕對該模型彈出窗口執行了任何操作,其他選項卡中的其余綁定數據將消失。 我只想刷新該特定標簽。

我使用此代碼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);
                });
        }

您必須更具體地了解模型和視圖。 通常,這是范圍的問題。 您必須檢查更改應用到哪個$ scope以及更改應用到哪個模型。 您想通過location.reload()實現什么?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM