Way to ng-repeat defined number of times instead of repeating over array?

前端 未结 26 3669
刺人心
刺人心 2020-11-22 14:53

Is there a way to ng-repeat a defined number of times instead of always having to iterate over an array?

For example, below I want the list item to show

26条回答
  •  半阙折子戏
    2020-11-22 15:35

    I needed a more dynamic solution to this - where I could increment the repeat.

    HTML

    Duplicator Control

    
    Create another user with the same permissions
    
    

    JS

     $scope.newUserCount = Array('1');
    var primaryValue = 1;
    $scope.duplicateUser = function()
    {
        primaryValue++;
        $scope.newUserCount.push(primaryValue)
    }
    

提交回复
热议问题