Angularjs 获得;错误:[$rootScope:infdig]10$digest()已达到迭代次数;消息

Angularjs 获得;错误:[$rootScope:infdig]10$digest()已达到迭代次数;消息,angularjs,html,Angularjs,Html,我想在一个表的html页面上显示http响应(JSON响应)。为了实现这一点,我写了下面的控制器函数 $scope.getSensorInfo=function(){ var strippeddata = []; $http({ method: "GET", url: "http://xx.xx.xx.xx:4000/co

我想在一个表的html页面上显示http响应(JSON响应)。为了实现这一点,我写了下面的控制器函数

$scope.getSensorInfo=function(){                                
            var strippeddata = [];
            $http({
                method: "GET",
                url: "http://xx.xx.xx.xx:4000/config",
                params: {did: $scope.cid}
            }).then(function (success) {
                if (success.data[0] === undefined) { //no device is available with this id
                    $http({
                        method: "GET",
                        url: "http://xx.xx.xx.xx:4000/info"
                    }).then(function(success1){
                        $scope.sinfo = success1.data;                            
                    },function(error1){
                        console.log('Error ' + JSON.stringify(error1));
                    });
                } else {
                    Object.getOwnPropertyNames(success.data[0].obj).forEach(function (item, idx, list) {
                        Object.defineProperty(strippeddata, idx, {
                            enumerable: true,
                            configurable: true,
                            get: function () {
                                return {
                                    name: item,
                                    periodicity: success.data[0].obj[item].periodicity,                   
                                }
                            }
                        });
                    });
                    $scope.sinfo = strippeddata;
                }
            }, function (error) {
                console.log('Error ' + JSON.stringify(error));
            });
    }
我的html代码如下

 <div class="row">
          <div class="form-inline form-group">
          <div class="col-md-3">
              <label for="cnfdeviceid">Device ID</label>
              <input class="form-control input-md" type="text" id="cnfdeviceid" placeholder="e.g. HYD01" ng-model="confdeviceid" ng-blur="getSensorInfo()"/>
          </div>
          </div>
 </div>



<div ng-repeat="y in sinfo" class="[ form-group form-inline ]">
           <input class="form-control input-md" type="checkbox" id="{{y.name}}" ng-model="name" ng-change="verify(y.name,y.periodicity,y.formula,name,$index)" autocomplete="off"/>
           <div class="[ btn-group ]">
             <label for="{{y.name}}" class="[ btn btn-success ]">
             <span class="[ glyphicon glyphicon-ok ]"></span>
             <span> </span>
             </label>
             <label for="{{y.name}}" class="[ btn btn-default active ]">
               {{y.name}}
             </label>
           </div>
           <input class="form-control input-md" type="text"  ng-model="y.periodicity" placeholder="periodicity" id="{{y.periodicity}}" autocomplete="off"/>
    </div>

更改$scope.sinfo=strippeddata;到$scope.sinfo=strippeddata.slice();解决了这个问题

$scope.sinfo = strippeddata;