angular Infinite $digest Loop in ng-repeat

前端 未结 3 575
傲寒
傲寒 2020-12-19 07:53

I want to call function in ng-repeat attribute, here is my code

example plnkr

html


  
3条回答
  •  旧时难觅i
    2020-12-19 08:22

    Found the solution:

      $scope.prev = null;
      $scope.getGroupedRange = function() {
        var data = [{
          val: 1,
          abs: 1,
          rel: 1,
          cum: 1,
          id: 123456
        }];
        if (angular.equals($scope.prev, data)) {
          return $scope.prev;
        }
        $scope.prev = data;
        return data;
      };
    

提交回复
热议问题