Javascript 列表显示时达到AngularJS 10$digest()迭代次数

Javascript 列表显示时达到AngularJS 10$digest()迭代次数,javascript,angularjs,Javascript,Angularjs,我的js代码是: // 在变更分布的时候,重新获取数据条目 $scope.reGetProducts = function(){ // 发送给后台的请求数据 $scope.model.cpage=$scope.paginationConf.currentPage; $scope.model.len=$scope.paginationConf.itemsPerPage; $http({ method : '

我的js代码是:

// 在变更分布的时候,重新获取数据条目
$scope.reGetProducts = function(){
        // 发送给后台的请求数据
        $scope.model.cpage=$scope.paginationConf.currentPage;
        $scope.model.len=$scope.paginationConf.itemsPerPage;

        $http({
            method  : 'POST',
            url     : '<%=request.getContextPath()%>/sysConfigManage/querySysConfigList.action',
            data    : $scope.model,  // pass in data as strings
            headers : { 'Content-Type': 'application/x-www-form-urlencoded' }  // set the headers so angular passing info as form data (not request payload)
        }).success(function(data){
            // 变更分页的总数
            $scope.paginationConf.totalItems = data.total;
            // 变更列表条目
            $scope.items = data.rows;
        });
    };

    // 配置分页基本参数
    $scope.paginationConf = {
        currentPage: 0,
        itemsPerPage: 10
    };
    $scope.model = {};
    $scope.items = {};
    // 通过$watch currentPage和itemperPage 当他们一变化的时候,重新获取数据条目
    $scope.$watch('paginationConf.currentPage + paginationConf.itemsPerPage',$scope.reGetProducts);
//在变更分布的时候,重新获取数据条目
$scope.reGetProducts=函数(){
// 发送给后台的请求数据
$scope.model.cpage=$scope.paginationConf.currentPage;
$scope.model.len=$scope.paginationConf.itemsPerPage;
$http({
方法:“POST”,
url:“/sysConfigManage/queryconfiglist.action”,
data:$scope.model,//以字符串形式传入数据
标题:{'Content Type':'application/x-www-form-urlencoded'}//将标题设置为将信息作为表单数据传递(而不是请求负载)
}).成功(功能(数据){
// 变更分页的总数
$scope.paginationConf.totalItems=data.total;
// 变更列表条目
$scope.items=data.rows;
});
};
// 配置分页基本参数
$scope.paginationConf={
当前页面:0,
物品价格:10
};
$scope.model={};
$scope.items={};
// 通过$查看当前页面和项目每页当他们一变化的时候,重新获取数据条目
$scope.$watch('paginationConf.currentPage+paginationConf.itemsPerPage',$scope.reGetProducts);
html是

<tr bindonce ng-repeat="item in items">
    <td>
        <button type="button" class="btn btn-success" ng-click="getDetaile(item.ID)">详情</button>
        <button type="button" class="btn btn-danger"  ng-click="del(item.ID)">删除</button>
    </td>
    <td bo-text="item.NAME"></td>
    <td bo-text="item.CODE"></td>
    <td bo-text="item.VALUE"></td>
    <td bo-text="item.MEMO"></td>
</tr>

详情
删除
为什么会出现这样的错误当然,请帮助我,,,..

问题在于:

 $scope.$watch('paginationConf.currentPage + paginationConf.itemsPerPage',$scope.reGetProducts);
你正在监视一个永远不会稳定的手术。在每次摘要调用中,angular将比较计算结果并比较两个新对象

阅读更多信息:$rootScope/infdig

因此,角度不能确定一个稳定的模型。你可以很容易地写下:

$scope.$watchGroup(['paginationConf.currentPage', 'paginationConf.itemsPerPage'], $scope.reGetProducts);

当您仅在“paginationConf.currentPage”或“paginationConf.itemsPerPage”上使用$watch时,$watch是否正常工作?代码段中没有任何提示,但此错误通常是由
$watch
的死循环引起的,这意味着您在watch处理程序中监视a并更改a。